-
AuthorPosts
-
May 6, 2024 at 8:52 am #1442411
Is there a way to convert builder elements to shortcodes to use them in another place?
Example:
I create a section with an image and a button in a page. As I can add a custom CSS class, imagine I can add a custom shortcode name.
Then I go to another page and add that shortcode that will be displayed.
If I edit the original, then everything else gets updated.
The idea is that the client can edit visually the section and done. I know I can add any content to any page with functions, but then the client will need to know how to do that and that is what I am trying to avoid.
Maybe a custom content shortcode plugin or something similar?
Any recommendations?
Thanks.
May 7, 2024 at 4:06 am #1442502Hey peterolle,
Thank you for the inquiry.
Have you tried using the Custom Element Templates? They function similarly to builder elements but can be updated globally. Please refer to the documentation below for more info:
// https://kriesi.at/documentation/enfold/custom-element-templates/
Best regards,
IsmaelMay 7, 2024 at 9:43 am #1442532Hey Ismael.
I will use that content below woocommerce products, so it needs to be using shortcodes or other method.
This is the scenario and example:
The client creates a callout.
I add that below related products.
The client can edit that callout anytime.Thank you.
May 9, 2024 at 6:15 am #1442760Hi,
Then I go to another page and add that shortcode that will be displayed.
Looks like the Page Content element might be of use here. You can use this element to display the content of another page. If this is not the case, then I’m afraid you’re out of options. You may need to look for a plugin or extension.
Best regards,
IsmaelMay 13, 2024 at 7:54 am #1443184Hey Ismael.
How can I insert that content in other page using a function?
Let’s say under related products in a product page, where there is no builder available.
Thank you.
May 13, 2024 at 10:49 am #1443219Hi,
You can use the Page Content element’s shortcode along with template hooks to insert it below the related products section. Example:
add_action('woocommerce_after_single_product_summary', function() { echo do_shortcode("[av_postcontent link='page,3206' av_uid='av-lw4q0mos' sc_version='1.0']"; }, 25);
Best regards,
IsmaelMay 21, 2024 at 9:17 am #1444881Thank you Ismael!
So, I create a single page with the builder and add one element, let’s say a button.
I grab the page ID, in this case: 3206
Then I add that with the function to the desired page to appear.After that I can edit the page and everything in there will be displayed as per the function.
Is that correcto or I am missing some step?
May 22, 2024 at 5:52 am #1445057Hi,
After that I can edit the page and everything in there will be displayed as per the function.
Yes, that’s how it should work. If you encounter issues, let us know.
Best regards,
IsmaelMay 24, 2024 at 11:05 am #1445494Thank you Ismael, you can mark this as solved.
Have a great day!
-
AuthorPosts
- The topic ‘Builder elements to shortcodes’ is closed to new replies.