I am trying to:
This site has been on layouts for a long time and I cannot switch away from layouts at this time. I use a layout for single WooCommerce Products. The product short description is used directly in the layout but the long description (which is the post_content) is presented in a tab that is put in the layout via a shortcode. So, layouts doesn't think there is a post_content field in the layout and hides the editor when editing a product.
When I edit the product, even if I do not touch the post_content field, the product loses its assignment to the Single Product Layout and shows on the front-end as not having any layout assigned. I have to then go to the Layout and re-assign the product to fix it.
Link to a page where the issue can be seen:
You need to be logged in to edit a product and see this happen. If you can't replicate it on your own test site I will set you up to access our staging server.
I expected to see:
The product should retain its assigned layout when I edit it unless I explicitly tell it to create a one-off layout for that product.
Instead, I got:
The layout assigned goes away and the product won't show properly on the front-end until I fix it.
This is a big issue as the client edits products but is not trained in how to manage layouts and assign them to products so they keep breaking products.
Hello,
I assume you are going to design your website with Toolset Layouts plugin, please try to deactivate Toolset Blocks plugin of your website, and install the Toolset Views plugin, and test again.
You can download it here:
https://toolset.com/account/downloads/#legacy-plugins
Click link "Legacy plugins"
Thanks Luo, I already know that this problem does not happen with the legacy Views plugin instead of blocks. But it seems like the functionality in Blocks and Views that handles the issue of a layout assignment for a post should work the same. These posts are Products so they are edited with the Classic editor, not the block editor. I will eventually remove Layouts completely from this site but it isn't simple to do so because we have Views in Archive Layouts and because WooCommerce Views is an all or nothing change -- I can't remove it from one part of WooCommerce until I can remove it from all because there is code in Layouts and WC Views that acts differently when both are installed. So, for example, I cannot switch the Single Product Layout to a Content Template.
At any rate, going back to Legacy Views will help for now but I'd like to have this identified as a bug to development to fix. Despite best intentions, things go away and if Views eventually goes away but I can't be done with Layouts by then, it'd be good if Blocks keeps up with Layout compatibility .... not for all features but for breaking bugs at least.
This is expected result, Toolset Blocks plugin does not handle the issue of a layout assignment for a post should work the same.
If you are using Blocks plugin, you will not be able to assign the layout to post, so we provide the legacy Toolset Views plugin for this case.
In the future, after you migrate all posts to content template(with Blocks editor), you can simply switch to Blocks plugin instead of Views plugin.
Are the bug fixes and performance improvements that are being made to blocks also being made to the legacy views plugin?
I told you why I cannot easily move this site from layouts to content template above. So I'm stuck with layouts for some time to come. If views is not going to receive the same attention to performance, security and bug fix improvements at blocks, then Toolset is not living up to its commitment to support both approaches to sites.
If Views is receiving all the relevant improvements that are made to blocks then I am okay for now.
My issues isn't post templates, it is archive layouts that contain views and WooCommerce Views in particular. With WooCommerce Views, you cannot easily migrate one template at a time. Layouts has to be disabled for the change to content templates to work at all. That is not an easy change to make.
Hi,
Thank you for sharing these details. Luo is on vacation, so I'll be following up on this ticket.
> Are the bug fixes and performance improvements that are being made to blocks also being made to the legacy views plugin?
- Yes, I can confirm that at the moment ( and there are no plans to change that immediately ), the development and releases of the Toolset Views and Blocks are being managed side-by-side. At the core, they are both the same plugins, with just some differences in the default settings for the editor experience.
Based on this, the only thing a Views plugin user will be missing out ( compared to the Blocks ), would be the ability to automatically update the plugin from the admin area.
( this applies to all legacy plugins and you'll only be able to update them manually: https://toolset.com/account/downloads/#legacy-plugins )
Note: Your website's debug info shows that Layouts 2.6.5 is active, whereas the latest version is 2.6.7, so please update it manually.
As for the issue itself, I suspect that if the layout assignment is resetting for products, it should be happening no matter if Views or Blocks is active.
I'll need to perform some tests and research to confirm this and I'll update you with my findings, once done.
Thank you for your patience.
regards,
Waqar
If you think the issue will happen with Views and Blocks, then I don't think I should manually update to Views 2.6.7 as that would re-introduce the problem that I resolved by switching from Blocks back to Views. If you find otherwise, please let me know and I'll manually update.
I apologize for the delay in getting back on this, as I had an unusually busy queue over the weekend.
I'll be able to share my findings in the next few hours.
Thank you for waiting.
I've tested the layout assignment for single WooCommerce products, on a couple of different server environments, with the latest WordPress, WooCommerce, Views & Blocks, but couldn't reproduce the issue. The assigned layout remained assigned, after editing a product from the admin area edit screen.
(the active theme was Twenty Twenty-One)
I'll recommend testing this again, making sure that everything is updated to the latest versions.
( Note: The Layouts and Views plugin updates are now available from the automatic update section in the WordPress admin )
In case the issue still persists, you're welcome to share a clone/snapshot of the website so that this can be investigated further.
( ref: https://toolset.com/faq/provide-supporters-copy-site/ )
I've set your next reply as private.
I can't give you access because I switched from Blocks to Views which solved the problem for now. The key, I think, is that the content template didn't have a post content field (the body is shown on the page but via a shortcode so Toolset doesn't know it is there and covers the post body in the editor with the no content area warning).
I'm working on removing layouts from this site so I don't need this resolved but it may affect others.