Tagged: advanced layout builder, shortcode parser
-
AuthorPosts
-
December 22, 2018 at 7:46 pm #1048601
Hello:
I am a non-developer who has relied on Enfold ever since it came out to make my small number of clients very happy. As their needs have evolved, I’ve had to push Enfold harder in terms of integrating with other plugins, and more specifically, getting it to work with custom post types and taxonomies that I’ve created using other plugins.To that end, I have been experimenting with the Custom Content Shortcode plugin to create loops of a custom post type. My hope was to use Enfold content widgets (columns, mainly) to create custom grids from a custom post type and taxonomy. I suspect that this is probably stretching Enfold’s admin UI to the limit, but I’m not a PHP developer so I had hoped to use this plugin rather than get into templating.
I can make a simple loop work by copying from the debugger window in the Enfold UI, but when I try to get more complex (e.g., adding [if] [else] statements that break up an enfold block), it breaks the Enfold layout builder. I think it has to do with the order that the shortcodes are processed. The loop works, but Enfold’s shortcode tag doesn’t get properly closed even though the syntax looks right. I tried the helpful shortcode parser and it’s definitely struggling with the effects of the loop and the if statements.
So, a few questions related to this:
- – Is there a way to prioritize the shortcode process order at some level in Enfold?
- – Is there a way to force a single page to not enable the ALB using a setting
- – In the case of how Enfold creates advanced layouts, each shortcode element is given a unique ID. Is this critical from an output perspective? I can create unique IDs using the looping plugin, but they probably won’t have the right syntax if there’s a dependency]
Thanks in advance for any insights. I know the proper answer is probably ‘hire a developer’ or ‘learn to code for WordPress’, but I was so happy to find this content plugin because it gave me more control and streamlined things for my editors, now I’m hoping to make use of it with Enfold rather than using raw HTML/generic layouts.
Feature suggestion: figure out how to integrate this plugin into Enfold to create a powerhouse of possibility.
Thanks in advance for any suggestions about shortcodes and hacking the raw Enfold shortcode output.
- This topic was modified 5 years, 12 months ago by ilowelife. Reason: Formatting
December 29, 2018 at 8:08 pm #1049195Hey ilowelife,
Thank u so much for your great words, but also for the really nice details on your comments.
Yes that plugin is really good. Most of the answers are no – but before we say a no – it is possible to share us a page that brakes?
That way we might be able to figure out what is happening and maybe able from our side to also provide a fix.We appreciate it a lot!
Best regards,
BasilisJanuary 5, 2019 at 8:19 pm #1050383This reply has been marked as private.January 8, 2019 at 11:52 am #1051346Hi,
You can’t use another shortcode as an attribute value because of how the theme parses the shortcode but you can create a custom shortcode based on the current av_image shortcode.
// https://codex.wordpress.org/Function_Reference/add_shortcode
Example:
function custom_image_shortcode_func( $atts ) { $image = do_shortcode('[field image-url]'); $cv = do_shortcode('[field cv_custom_url]'); $title = do_shortcode('[field title]'); return do_shortcode("[av_image src='".$image."' av_uid='av-5y6rbx' attachment='".$image."' attachment_size='full' align='center' styling='' hover='' link='".$cv."' target='_blank' caption='' font_size='' appearance='' overlay_opacity='0.4' overlay_color='#000000' overlay_text_color='#ffffff' copyright='' animation='no-animation' av_uid='av-jpz4q5h9' custom_class='' admin_preview_bg='']".$title."[/av_image]"); } add_shortcode( 'custom_image_shortcode', 'custom_image_shortcode_func' );
Best regards,
IsmaelJanuary 30, 2019 at 1:30 am #1060279Thank you Ismael.
Not perfect, but I’ll give it a try.
I’m curious about whether the uid attribute in the avira components is required. If it is, should I figure how to generate something unique for this?
Thanks
January 31, 2019 at 1:10 pm #1060951 -
AuthorPosts
- You must be logged in to reply to this topic.