I'm creating a user account page that shows views of two different post types - businesses and offers. For some reason, when I set one to the correct content (post type), the other one is changed to match it. Take a look at hidden link.
You can log in as me - john@horning. The site is not live.
Under "My Business", you should see "Local Leader" and under "My Offers", you should see "Test Offer" and "Test Birthday Offer"
Thanks.
Hi,
I've checked the page and noticed that both view blocks under these headings are using the same view named 'My business'. This is why making changes in one, updates the other, as well.
You can remove the view block from under 'My Offers' and add a new one, that creates a new view and not uses the existing one.
regards,
Waqar
I duplicated the "My Businesses" view and then renamed the second one to "My Offers", and changed the content to "Offers". But both views are still showing the same content. Isn't that a bug?
If you check the names used in both the view blocks on the page, you'll see that they're both using the 'My Offers' view.
( screenshots attached )
Also, at WP Admin -> Toolset -> Views, you'll only find this 'My Offers' view that is created using the blocks editor.
It seems you've duplicated the view block, which doesn't create a duplicate of the view itself. That will only make another copy of a view block that is referencing the same view as the original.
To properly create an independent duplicate of the view, you can insert a new 'View' block and then select the same view as the existing view. Once inserted, you'll be asked to either edit the original or edit a copy. You'll select the edit a copy option and its copy will be created, which can be edited independently.
Thanks for the info. I added a new view block and set it up.
Typically, when you duplicate something like a page, the new page is independent of the original. If I understand correctly, that is not the case when duplicating a View block. This is confusing and not intuitive, and I see no reason to even allow duplication.
When I created a new view, I didn't see options to "edit the original or edit a copy" (as you say). I only saw "Create a new view" and "Use existing view" (see image).
Thanks for the update. I see the two independent views working on the page, now.
> Typically, when you duplicate something like a page, the new page is independent of the original. If I understand correctly, that is not the case when duplicating a View block. This is confusing and not intuitive, and I see no reason to even allow duplication.
- I can see how this can be confusing, considering how the block duplicate feature works for regular blocks.
But, a view block is unique since it calls a separate entity a 'view' inside it. In this scope, it makes sense how duplicating the block and duplicating the view, works differently.
> When I created a new view, I didn't see options to "edit the original or edit a copy" (as you say). I only saw "Create a new view" and "Use existing view"
- Yes, from the options shown in your screenshot, you'll insert the existing view first.
( screenshot-1 )
Next, once the view has been inserted, you'll see the option to make its copy, while hovering over it.
( screenshot-2 )