In the wpv-view shortcode it is possible to enter a custom attribute like this: [wpv-view name='my-view' my-attribute='my-attribute-value'] Then you can control the views filter using arguments, which is described here: https://toolset.com/documentation/legacy-features/views-plugin/passing-arguments-to-views/#accessing-the-arguments
This is a great feature!!! My question is: How can we do this with the (new) Gutenberg block editor interface? There is no option to enter an attribute to the view. That's why we enabled the legacy interface and created the view that way. Then we inserted the wpv-view shortcode to the gutenberg block editor. It works, but is there a way to do this directly within the gutenberg block interface?
Hi,
Your observation is correct and currently, it is not possible to pass a shortcode attribute to a view through the 'View' block in the Gutenberg editor.
However, you don't necessarily have to create the view using the legacy editor, to use this feature. You can create a view using the 'View' block in Gutenberg and when you have to load or call it in a page or content template, you can use the view's shortcode ( e.g. [wpv-view name='my-view' my-attribute='my-attribute-value'] ) instead of the view block.
regards,
Waqar
Hi Waqar, thank you for your quick reply and your tip. My issue is resolved.