When I create a Reusable Block for Pagination inside a View (Block Editor) I get this message (screenshot).
The workaround to use the same styled pagination block in multiple views (other than to re-create the style) is to create the Re-usable block, place it in a different view, and convert it back to a regular block.
I am not sure to follow 🙂
Paginations belong to views, they can't be used outside, so that should be the reason you can't "re-use" it directly.
The pagination also will depend on input data, that depends on the View itsel
I, however, understand you found a workaround that allows you to re-use paginations?
Does this work fine in the front end? It could cause issues, I can imagine, if the View changes.
Maybe I misunderstand, please apologise if so.
Hi Beda
Yes, pagination is only to be used in views. But... lets say you have 20 views and 10 archive views. If you want to use the same styled Pagination on each view it means styling the pagination by hand - 30 times! But... Blocks supports re-usable blocks, so you could set the pagination block to be a re-usable block then place it in the 30 views (saving a lot of time and effort). However, if you set a block to be re-usable you get the message (as per screenshot) where it is placed. You can use it and then turn it back into a regular block and it works fine on each view but the error message is a little confusing!
Cheers
Gavin
All messages we get when pressing "Add to reusable blocks" are completely unexpected, actually.
1. Block must be placed inside View Output, View Search but not inside View Loop
Well, it IS placed inside a View Output and it is not in a View loop. In fact, I am only yet CREATING the reusable block and hence, what's the point in warning me it's wrong if this is just all a vanilla view.
2. The pagination block needs the View to have pagination enabled. Pagination can be enabled from the Settings Sidebar.
Well, again, I have pagination enabled, as otherwise, that block wouldn't even appear, and I couldn't even tell it to become a reusable block.
All this, whether it later works or not, is already an issue. I apologise I did not realize this earlier.
Whether or not a pagination block, in fact, can or should be used like that will be clarified as well in the process of reporting this issue.
In any case, the messages are wrong 🙂
I'll keep you in the loop about the progress here.
So I have some news...
1. Pagination (and other) blocks shouldn't support reusability and we are looking into ways to remove the option
2. With that also any annoying warnings or messages will be removed
3. It is then however not possible re-using Views, Paginations and other elements with this feature.
To re-use such elements you would re-use the whole View, which is possible, with the Views Block itself.
To have re-usability on the Pagination block, it would require other, new features.
It might be possible but would require more features that are not yet implemented.
You could ask for this at https://toolset.com/home/contact-us/suggest-a-new-feature-for-toolset as a new feature.
Please do not stop allowing Pagination to be added to re-usable blocks as this is VERY useful - even if you have to convert it back to a regular block to be used!
If it is not possible to prevent a warning message then all that needs to change is the warning message to say something like...
"Pagination blocks may be added to re-usable blocks but please convert back to a regular block to be functional."
Cheers
Gavin
Well, I cannot change this, and it makes sense not supporting it.
I suggest adding this as a feature request because the current intended behaviour is that it should not be used as a reusable block
I have added your voice to the internal issue tracker but it will be better if you add the request