I am working on designing a custom setup and at this point I am testing on what will work and what will not. I have a few questions regarding FLBuilder::render_query and the shortcode.
I am creating a custom page template in my child theme and then on that custom page template I inserted FLBuilder::render_query to call a BB layout that I had saved. I then made a page and selected my custom page template. The page loads the BB layout just fine, but the content is not editable on that current page. I can only edit the content on the page if I edit the original BB template. Seems no matter where I insert a BB template using the FLBuilder::render_query method, the layout is not editable unless I go and edit the original BB template. Should I be able to edit on the current page?
If I use the fl_builder_insert_layout shortcode then I can edit the BB template directly on the page that it is being used on. Which is what I assumed I could do with the FLBuilder::render_query method.
What I need to do is insert a BB template within my PHP so that it is editable.
This will render the BB template with an ID of 631, but I can not edit it within the current page. The only way I can edit the BB template is if I go to the original template and edit it there. However, I need to be able to edit it from within the page itself.
If I launch the Page Builder while on the page the Layout Settings lightbox will load showing a list of templates to choose from.
If I was to create a standard WP page and insert the fl_builder_insert_layout from within the editor like so…[fl_builder_insert_layout id="631"] it will allow me to edit the BB template with the ID of 631 on that current page without the need to go to the original BB template.
I need to be able to insert a BB template into a custom page template and make it so I can edit it directly on the page.
The builder is only designed to edit content for the current layout. You can’t edit another post’s layout from another post if that makes sense. The render_query and shortcode are actually the same. Just that the former can be used directly in a template, while the latter on the frontend.
[fl_builder_insert_layout id="631"] it will allow me to edit the BB template with the ID of 631 on that current page without the need to go to the original BB template.
This should not be the case! Do you think you can share the URL of the site along with temp admin access to we can check?
Don’t want to hijack this thread but I have the exact same question. New to BB and was under the impression (like the OP) that if I used the shortcode to add a Global Row to say the ‘footer.php’ template, it would be editable wherever it appeared.
I have a group of phone numbers that need to be edited in one place for ease of use. Is this not the case?
That’s not going to be the case. The builder is only designed to edit content for the current post. If you place content from another post/page/template using either the shortcode or render_query method, you will only be able to edit its content if you edit the post/page/template itself, not on the post where you added it.
David,
The the_contentfunction is what calls the Post content. Since you don’t have that on your template, even if you add content using the native WP editor, it won’t appear on the page. The builder can’t add content as well since we’re tapping on the same function. Where are you trying to add your layout? Can you leave the loop there and add it on top of it like so…
I understand that the_content tag is needed within a loop, but that then creates a separation in content which does not work for in in this case. I need to be able to edit everything on the page the same way.
Thanks for all your help on this, but I need to come up with another solution for my project.
The main problem is that there is an inconsistent work flow with adding and editing saved BB templates. If you add BB templates manually to a page whether it be shortcode or by the FLBuilder::render_query method then that BB template is not editable on that current page. It can only be edited from the main template post (being the post type fl-builder-template).
However, on the flip side if you create a new page, activate the page editor and insert the same saved BB template or drag in a saved row or module template then it can be edited on the current page.
Thanks again for you help.
The reason that shortcode or render_query content has to be edited in the original layout is because the builder is designed to work with the current post ID.
If we enabled editing of those in any layout it wouldn’t work because the data for those layouts doesn’t exist in the post meta for the current post.
Global rows can’t be edited in any layout either because only the row data is stored in each post they are added to. None of the column or module data is stored. That is all queried from the original layout.
Global modules can be edited in any layout because the module data is stored in the post meta for the layouts they are added to similar to global rows. Modules don’t have any child nodes in them, so we don’t have to worry about that issues as we do with global rows.
Finally, standard saved row/modules can be edited in any layout they are added to because all of the data for those is added to the current layout when you drop them in, so it’s available to edit.
After discussing this with you, we are going to look at the ability to edit shortcode and render_query content in a similar fashion to global rows. When you click to edit a global row, a new window opens up allowing you to edit the original layout. When you’re done it closes and refreshes the layout that you were on with the changes. Hopefully that will work for you.
Let me know if you have any questions about that. Sorry I don’t have the answer you were looking for.
Hi Justin,
Thanks for getting back to me and I understand the reasoning. I think your future solution for editing the shortcode and render_query content sounds like a great idea. I think it will fill that missing element to the workflow when adding/editing templates using those two processes.
Thanks again for your time and all the work with BB.
You’re welcome, David! Thanks for understanding. I filed an issue to get that working and hope to have it done sooner than later. I think it will be a great addition.