-
AuthorPosts
-
November 3, 2021 at 11:13 am #1327602
I built a simple 1/3 layout with Avia Layout Architect and copied the shortcodes from the post_content (post table) column 1:1 into my own plugin. If I send the shortcodes now through the do_shortcode function, around each div class=”flex_column” a separate div class=”flex_column_table” wrapper is opened and so all columns are in a separate row.
If I print the output before “do_shortcode” and copy it manually into a new wordpress page, everything is correct.
Do the [av_one_third] shortcodes not work correctly with do_shortcode? Of course, I made sure that only every third column gets the class “first”.
Update:
I saw that after each flex_column is the following comment:
“<!–close column table wrapper. Autoclose: 1 –>”
“Autoclose” sounds like the problem. What decides when to autoclose and can I decide that manually?Update 2:
I tracked it down to the following lines in your columns.php (wp-content/themes/enfold/config-templatebuilder/avia-shortcodes/columns/columns.php – Line 1638):` if( ( false === $force_close ) && ! empty( avia_sc_columns::$first_atts[‘min_height’] ) && ( ‘av-equal-height-column’ == avia_sc_columns::$first_atts[‘min_height’] ) )
{
if( ! isset( $meta[‘siblings’][‘next’][‘tag’] ) )
{
$force_close = true;I do use “min_height=’av-equal-height-column'” and when calling “do_shortcode” the $meta[‘siblings’][‘next’][‘tag’] is always empty. If I use the same avia-shortcodes in a wordpress page, the $meta[‘siblings’][‘next’][‘tag’] contains the next “av_one_third” tag.
Why does your $meta variable do not contain the next elements, when using do_shortcode? I can guarantee that the exact same code will work if I copy it into a blank WordPress page. Then $meta again contains information about the next tags.
November 8, 2021 at 9:02 am #1328188Hey xela,
Thank you for the inquiry.
The sibling elements are assigned based on the shortcode tree, which is only built when actually using the advance layout builder. This is why the sibling elements are missing when using the do_shortcode function or when using the theme shortcodes externally.
Have you tried using the templates feature or the Custom Element Templates option instead of creating a custom shortcode?
// https://kriesi.at/documentation/enfold/custom-element-templates/
Best regards,
IsmaelNovember 8, 2021 at 9:32 am #1328193Thanks for your reply!
What is the “templates feature”?
We are looking for a way to allow the frontend designer to create a layout using Advance Layout Builder, so I can use this layout in a plugin to e.g. output posts of a custom post type using this layout.
So far I have copied the generated HTML markup from the page, which is not an elegant solution.November 10, 2021 at 2:12 pm #1328501Hi!
Thank you for the update.
What is the “templates feature”?
The template option or feature is only available in the Advance Layout Builder (ALB). The template option allows you to save the current content of a page or post as template and reuse it later on.
Regarding the issue, you may need to copy the actual HTML generated by the shortcodes (only for the columns elements) or create a new builder element based on the existing columns element without the condition that you mentioned above. In order to create a new shortcode, you have to create a new shortcode path in the child theme.
// https://kriesi.at/documentation/enfold/intro-to-layout-builder/#add-elements-to-alb
Regards,
IsmaelFebruary 23, 2023 at 9:59 am #1398971Regarding the issue, you may need to copy the actual HTML generated by the shortcodes (only for the columns elements)
In the meantime, is there a more elegant solution? As a reminder: We want the frontend designer to prepare a layout using Advanced Layout Builder and then use it in a template file for a Custom Post Type.
Do we still need to mix HTML tags with shortcodes?February 26, 2023 at 10:15 pm #1399350 -
AuthorPosts
- You must be logged in to reply to this topic.