Hi,
I am building a site which uses multiple copies of the same view with a different query filter.
I have tried saving the view as a block and re-using the same block on the next page and editing it to a new block, saving the view as a pattern and using that on the next page and modifying the query filter and adding the view to the new page then clicking the create a copy button then editing the query filter in the copy but each has failed in its own particular way.
Surely I do not have to recreate the view manually on each page setting up the styling etc etc. I have over 10 of these to do so that will take hours and hours of time.
Having read your documentation I thought I could add the view to the new page then click to create a copy then edit the query filter in the copy and i would have replicated my view with a new filter but after doing that I get a view not found error message.
Would be really helpful to have a view editor in the Toolset menu like we used to have before the blocks update so I could duplicate, edit, delete views because this is getting a little bit like way too much work at present.
Am I missing something or doing something obviously wrong here?
Thanks for any help you can provide
Kirk
Hello,
In some cases, you can pass different shortcode attribute to View's shortcode [wpv-view], see our document:
https://toolset.com/documentation/user-guides/views/passing-arguments-to-views/#controlling-the-filter-with-shortcode-attributes
section "Controlling the filter with shortcode attributes".
So you can pass different shortcode attribute to View's shortcode [wpv-view], and get different results.
So does that still apply to views created using the block editor?
In other words can I still call a view created using the block editor via a shortcode?
Yes, it should be able to work within Blocks editor, for example, edit a page/post with Blocks editor, add a shortcode block, and display the view's shortcode [wpv-view]
https://toolset.com/documentation/user-guides/views-shortcodes/#wpv-view
To be honest I couldn't make the view with an argument shortcode work for me.
he view insisted on displaying every entry post rather than just the one I was selecting for via the shortcode parameter.
here is what I used for my shortcode;-
[wpv-view name="Centre Manager" Centre Manager Location="Karrinyup"]
What I ended up doing was using an existing view then after I had added the view creating a copy which I then re-named.
I then created the query for the new location.
Just trying over multiple pages now to make sure the above process works for me now now.
thanks
Kirk
You can not use blank space in the shortcode attribute name, see WP document:
https://codex.wordpress.org/Shortcode_API
For example:
[wpv-view name="Centre Manager" Centre_Manager_Location="Karrinyup"]
Private message box enabled, in case you still need assistance for it.