Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #1472414

    Hi everyone,
    I’m testing the Dynamic Content new feature along with the Custom Layout and it works like a charm with ACF custom post types. Great job !

    After adding a few posts (using the custom fields defined for my CPT) manually, I tried importing the 200 posts I have into a CSV file using the plugin “Ultimate CSV Importer Free” (I’m not advertising, it’s just one of many but it’s free and works with CSV instead of WordPress native XML import/export files).

    I then noticed that my CPTs were displayed by default in the form of a blog post with the shortcodes of my Custom Layout content displayed in plain text.

    Then I saw that there was a field in the database called _aviaLayoutBuilder_active that had an active value, but it doesn’t seem to be enough to activate ALB on the post.

    Can you tell me what other custom fields are used to properly activate the Advanced Layout Editor on a post, and what values to give them?
    I can see that activating the Advanced Layout Editor then updating the post generates a lot of additional fields in the _postmeta table :

    • _aviaLayoutBuilder_active : active
    • _edit_lock : 1732749476:1
    • _edit_last : 1
    • _avia_sc_parser_state : disabled
    • _av_css_styles : a:0:{}
    • _custom_layout_post_id :
    • _aviaLayoutBuilderCleanData : [av_custom_layout link=’alb_custom_layout,653′ av_uid=’av-m3u7m8lu’ sc_version=’1.0′]
    • _avia_builder_shortcode_tree : a:1:{i:0;a:3:{s:3:”tag”;s:16:”av_custom_layout”;s:7:”content”;a:0:{}s:5:”index”;i:0;}}
    • _av_el_mgr_version : 1.0
    • _av_alb_posts_elements_state : a:1:{s:16:”av_custom_layout”;b:1;}
    #1472441

    Hey Arsène,

    Thank you for the inquiry.

    Are you trying to programmatically activate the ALB for the imported posts? You may need to import the entire posts and post meta tables to make sure that the ALB status is correctly activated when transferring the posts to another site. You can use plugins like Duplicator or WP Migrate DB in order to properly transfer the custom post types.

    Best regards,
    Ismael

    #1472455

    Hello Ismael,
    thank you for your quick answer !
    Unfortunately I can’t use the import/export tools for this CPT because it’s an Excel database of hundreds of entries from my customer that I need to transform into this freshly created CPT.

    So I’ve prepared my Custom Layout for this CPT (as well as all my custom fields, with ACF) and I’d like to be able to import the data and programmatically activate the Advanced Layout Editor.

    Using only the custom field _aviaLayoutBuilder_active with the “active” value, the Advanced Layout Editor is well activated but not rendered in frontend. I have to open the edition page of each CPT manually and then click “Update” in order to generate the proper avia custom fields.

    It’s quite frustrating to see that all my CPTs are ready, with the right content, but that because of this small detail there’s still a manual operation to perform on hundreds of posts.

    Best regards,

    #1472460

    Hi,

    Thank you for the update.

    The builder also requires these meta fields.

    _aviaLayoutBuilder_active
    _aviaLayoutBuilderCleanData
    _avia_builder_shortcode_tree
    _alb_shortcode_status_content
    _alb_shortcode_status_clean_data
    _alb_shortcode_status_preview
    _avia_sc_parser_state
    _av_alb_posts_elements_state
    _av_el_mgr_version
    

    You may need to directly edit the posts and activate the ALB manually in order to properly create these fields.

    Best regards,
    Ismael

    #1472572

    Thank you Ismael for your answer.

    Do you have some information about the expected values of each of these meta fields ?

    As each entry will use the same CPT and “Custom Layout”, I guess that I can anticipate the values even if some “post ID” or other parameters are included.

    It seems to me that being able to quickly mass publish CPTs (using ALB) is a fine demonstration of the power of Enfold and its great “Custom Layout” functionality!

    Best regards,

    #1472685

    Hi,

    Do you have some information about the expected values of each of these meta fields ?

    In your database, you can examine one of the pages built with the Advanced Layout Builder and search for the associated fields to understand the content each field holds. You can use the following query:

    SELECT meta_key, meta_value
    FROM wp_postmeta
    WHERE post_id = <your_post_id>
      AND meta_key IN (
        '_aviaLayoutBuilder_active',
        '_aviaLayoutBuilderCleanData',
        '_avia_builder_shortcode_tree',
        '_alb_shortcode_status_content',
        '_alb_shortcode_status_clean_data',
        '_alb_shortcode_status_preview',
        '_avia_sc_parser_state',
        '_av_alb_posts_elements_state',
        '_av_el_mgr_version'
      );
    

    Replace with the ID of the page. Make sure to create a database backup before proceeding.

    Best regards,
    Ismael

    #1472717

    Thank you Ismael for your answer.
    I’ll analyse the values of these fields and try to determine how to set them programmatically.

    The meta fields I’m the less sure about are the following (the values displayed below are from a CPT where I activated ALB manually) :

    • _avia_builder_shortcode_tree : a:1:{i:0;a:3:{s:3:”tag”;s:16:”av_custom_layout”;s:7:”content”;a:0:{}s:5:”index”;i:0;}}
    • _av_alb_posts_elements_state : a:1:{s:16:”av_custom_layout”;b:1;}

      Do you know if there is any Enfold documentation about the way their values are generated ?

      Best regards,

    • This reply was modified 2 days, 13 hours ago by agencelarsen.
    #1472770

    Hi,

    Thank you for following up.

    The _avia_builder_shortcode_tree is created using the build_shortcode_tree function, which can be found in the enfold\config-templatebuilder\avia-template-builder\php\class-shortcode-helper.php file. It retrieves the shortcodes, parses the content, and builds a structured tree of shortcodes, including their attributes and content. Unfortunately, the internal workings of the template builder are not documented.

    The _av_alb_posts_elements_state is an array containing all the shortcodes or elements in the page.

    Best regards,
    Ismael

    #1472912

    Hello Ismael,
    If I understand correctly your explanations concerning these custom fields, I should have the same values on all my CPTs since the very same Custom Layout template is used.

    I’ll compare a few posts in my database to confirm this hypothesis and, if that’s the case, I’ll be able to leverage the power of Enfold and its new features like never before.

    I plan to do this tomorrow, and I’ll post my findings in this conversation to help anyone else who might be interested.

    Best regards,

    #1472959

    Hi,

    I should have the same values on all my CPTs since the very same Custom Layout template is used.

    Yes, if all the items in your CPT will use the same custom layout, they should have the same tree structure. Let us know if you find anything.

    Best regards,
    Ismael

Viewing 10 posts - 1 through 10 (of 10 total)
  • You must be logged in to reply to this topic.