Skip Navigation

[Resolved] Creating Copies of a View with modified query filter

This support ticket is created 3 years, 4 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Hong_Kong (GMT+08:00)

This topic contains 5 replies, has 2 voices.

Last updated by Luo Yang 3 years, 4 months ago.

Assisted by: Luo Yang.

Author
Posts
#1858233

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

#1858283

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.

#1858285

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?

#1858289

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

#1861031

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

#1861159

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.

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.