-
AuthorPosts
-
November 28, 2024 at 12:54 am #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;}
November 28, 2024 at 9:03 am #1472441Hey 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,
IsmaelNovember 28, 2024 at 9:53 am #1472455Hello 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,
November 28, 2024 at 10:04 am #1472460Hi,
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,
IsmaelNovember 29, 2024 at 11:36 am #1472572Thank 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,
December 2, 2024 at 7:33 am #1472685Hi,
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,
IsmaelDecember 2, 2024 at 3:31 pm #1472717Thank 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.
December 3, 2024 at 8:38 am #1472770Hi,
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,
IsmaelDecember 4, 2024 at 1:33 pm #1472912Hello 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,
December 5, 2024 at 4:19 am #1472959 -
AuthorPosts
- You must be logged in to reply to this topic.