Tagged: Code block, Masonry Gallery, shortcode
-
AuthorPosts
-
June 27, 2017 at 6:57 pm #813569
Is it possible to put a masonry gallery on a page using the code block or text block elements? I need to put it on a page but have to wrap in in a div tag to do some class changes t try and use facetwp. Any ideas?
June 28, 2017 at 11:41 am #813756Morning,
Everything in enfold has a shortcode that can be used.
If using the default editor you can add elements via the little wand tool (second from the right).
This will create a nice shortcode, something like…[av_masonry_gallery ids='' items='24' columns='flexible' paginate='pagination' size='flex' gap='large' overlay_fx='active' container_links='active' id='' caption_elements='title excerpt' caption_styling='' caption_display='always' color='' custom_bg='' custom_class='']
Flip to the ALB and you can then use it inside a text block or codeblock.
Word of warning though… shortcodes inside building block sometime break so it isn’t advisable.If you want to add a css class to the element (you may have done this already?) follow these instructions
This will allow you to add a class to the masonry gallery so you can target it with css
hope that helps
TJ
June 28, 2017 at 4:54 pm #813955Hi hotspot01,
@tjswarbs78 thank you :) great team work!Have you tried what is suggested in the reply above?
Best regards,
VictoriaJune 29, 2017 at 2:55 am #814179Thank you. The shortcode worked for displaying the gallery but I’m still having trouble getting it to display the right posts. How do i choose what type of posts it will display? (ex: Category or taxonomy)
Your second option actually looks like a really good option as well as there is less chance of it breaking if I can just add the class straight to the element. I’ve tried giving it a custom id of test and a class of facet-template but when i inspect it doesn’t look like anything changes? The section is still showing as av-masonry-1 and no class has been added. Am I missing something?
- This reply was modified 7 years, 5 months ago by hotspot01. Reason: spelling
June 29, 2017 at 11:10 am #814346Hi,
Be easier to troubleshoot on a live page. If possible can you post a link?
No log in details just a link so I can inspect the page and take a look :)Thanks
Tim
June 29, 2017 at 10:55 pm #814734No problem. Here is the page in question.
http://akashhomes.com/quick-possessions/
I was able to use the shortcode in a code block and then add the Facetwp-template class to it. It looks like it is working except it is not pulling up the right posts. It is just pulling up items from the media library in order.
How do i specify the type of post and/or taxonomy I want displayed in the shortcode?June 30, 2017 at 10:33 am #814895Good Morning (or maybe Good evening in Canada?)
The masonry gallery element will only pull images. To display posts or custom post types you will have to use either the Blog post, portfolio grid, masonry or post slide elements found in the content element tab of the ALB.
You’ll need to crate the short code in the default editor. I don’t know how familiar you are with the default editor so I’ve done some screen shots.
Select the masonry element from the default editor.
you can the select post etc on next screen
It will the pump out a nice shortcode for you to use :)
Any issue just holla
TJ
- This reply was modified 7 years, 5 months ago by tjswarbs78. Reason: so image link open in new window
June 30, 2017 at 5:43 pm #815089Hi hotspot01,
You can enable the Advanced Layout Builder debug mode (http://kriesi.at/documentation/enfold/enable-advanced-layout-builder-debug/), add the masonry to your page via Advanced Layout Builder element, configure it the way you need and copy the code from the shortcodes block at the bottom and paste it wherever you need.
If you need further assistance please let us know.
Best regards,
VictoriaJune 30, 2017 at 6:29 pm #815106Thanks guys. That worked great. The correct portfolio entries are showing now and it seems to be working with only a few glitches. I think we’re almost there. Thanks for all the help.
July 1, 2017 at 7:17 am #815268 -
AuthorPosts
- You must be logged in to reply to this topic.