This thread is related to "Need help with a custom loop output in a View " found here:
https://toolset.com/forums/topic/need-help-with-a-custom-loop-output-in-a-view/
Your supporter Waqar helped me with some custom JS and CSS for displaying 6 columns in the first row, 5 columns in the second row, 6 columns in the third row, 5 columns in the forth row and so on. It worked perfect
After upgarding Views from version 3.0 beta 2, the custom code does not work anymore if I open the page and save it.
It's on this site
hidden link
I have restored a backup on a test site so you can see how it looked like before the upgrade
hidden link
I need your help to see what's mess up the custom code.
Thanks in advice
Regards
Rune
The working version of this uses Blocks, the not working version seems to use a Loop Wizard generated Grid (bootstrap).
These aren't the same HTML markups, classes and ids, so the code won't work
One is a wpv-grid-column, the other a wpv-block-column.
The "new-row new-row-margin" Div is completely missing, as well
This can't be the same View, even it has the same ID some changes must have been made.
Waqar's Custom Code addresses classes like wp-block-columns, wp-block-column, etc, which could have changed either due to the update or changes in the content of the View.
It is not to be relied on such classes if they come from any Plugin.
If you added them manually you can rely on, but a plugin can always change its classes at any moment.
This is also why we do not provide such custom code in the forum, strictly speaking.
You can try to change wp-block-columns in Waqar's code for the now used wpv-grid-column, but I fear this won't just simply solve this issue which surges from Custom JS code that was tailored to work on one very specific use case, which is depending on internal class names.
Hi Beda
Thanks for looking into this. Both the working version and the non working version uses blocks. No question about that. You can log into my WordPress backend at hidden link with the WordPress access details I sent you and see it yourself.
I'm pretty sure it is the latest version of Toolset Views that mess up the front page. Everytime I open the page and save it, it breaks. Something converts some of the blocks HTML markups, classes and ids to grid view.
You can try it for yourself. hidden link works. Log into hidden link, open the frontpage and save it. You will see that some of the blocks have been converted to grid code
Same username and password as hidden link
I hope you cam tell me how to convert it back.
Thanks again for looking into this.
Regards
Rune
Likely that is a class name that changed from beta release to the meanwhile stable release of blocks.
The code eventually needs to be updated to use the new classes.
It is always possible that custom code applied to arbitrary classes of any plugin may stop working because these arbitrary classes can (and will) change over time.
You could either add own classes or if you rely on core classes, update your code when the core classes change.
But that is not something the support of Toolset can provide, according to the support guidelines https://toolset.com/toolset-support-policy/
What you can do on this specific case, is update your code to use the classes that Toolset uses now:
- Instead of class "wp-block-columns" use "wpv-grid"
- Instead of class "wp-block-column" use "wpv-grid-column"
Then the code will work again, but still, rely on internal classes added by the plugin Toolset, so it may stop working again in the future. You'd then have to find the changes and update the code accordingly.
My issue is resolved now. Thank you!