Skip Navigation

[Resolved] Create view in view ? Alternative ?

This support ticket is created 3 years, 8 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/Karachi (GMT+05:00)

This topic contains 12 replies, has 2 voices.

Last updated by stephaneM-4 3 years, 8 months ago.

Assisted by: Waqar.

Author
Posts
#1708197

Hello,

I have a site that has this structure
A city with many companies
A company with many opinions

I have 3 custom post :
- cities
- compagnies
- opinions

City pages
-Company pages
--optinions

I succeeded to display in the city page the list of companies in the city. that's ok with my view.

Only I would like to display in this city page the list of companies AND also with the opinions of this company directly on the city page

But when I create a new view in the view it tells me this message: "Nested views creation is not supported at the moment."

i have tested to add the shortcode [types field='avis' item='@entreprise-avis.parent'][/types] in view but : only the first notice is displayed.

I'd like to get a visual in a city page with for exemple :

Company 1
notice 1 of company 1
notice 2 of company 1
notice 3 of company 1

----------------------

Company 2
notice 1 of company 2
notice 2 of company 2

-----------------------

Company 3
notice 1 of company 3
notice 2 of company 3
notice 3 of company 3
notice 4 of company 3

How do I display all notices in a view that show all the companies?

Thanks

#1708529

Waqar
Supporter

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

Hi,

Thank you for contacting us and I'd be happy to assist.

Your observation is correct and the Blocks based views, currently can't be nested within one another.

To achieve this, you'll need to create views, using the Classic editor, and here are the steps:

1. Please go to WP Admin -> Toolset -> Settings -> General and make sure that "Show both the legacy and Blocks interface and let me choose which to use for each item I build" option is selected for the "Editing experience" field.

2. Next, go to WP Admin -> Toolset -> Views and create a new post view "View to show companies related to a city".

This view will be set to show "Companies" posts, with a post-relationship filter, with respect to the "Cities Companies" relationship to show results related to the Post where this View is shown.
( screenshot: hidden link )

In the "Loop Editor" section of this view, you can select the desired format in which you'd like to show this list of related companies.

3. You'll create another post view "View to show opinions related to a company".

This view will be set to show "Opinions" posts, with a post-relationship filter, with respect to the "Companies Opinions" relationship to show the results that are related to the current post in the loop.
( screenshot: hidden link )

In the "Loop Editor" section of this view, you can select the desired format in which you'd like to show this list of related opinions.

4. Once both these views are ready, you'll add the shortcode of the parent view ( "View to show companies related to a city" ) in the content template for the single city posts:
( ref: https://toolset.com/documentation/programmer-reference/views/views-shortcodes/#wpv-view )


[wpv-view name="view-to-show-companies-related-to-a-city"]

And the shortcode for the child view ( "View to show opinions related to a company" ) in the loop of the parent view, so that it is used a nested view:
( screenshot: hidden link )


[wpv-view name="view-to-show-opinions-related-to-a-company"]

I hope this helps and please let me know if you need any further assistance around this.

regards,
Waqar

#1708603

Hello,
Very nice answer!
Thank you for your very detailed message, here is my sample page for a city :
hidden link

Can't I just create the view for the notices? The displays the companies is functional.
I am afraid to lose my design with the map and the listing? I don't master the css to be able to reproduce this same visual?

If I give you access to my admin, can you do it against a donation for example ?

TY

#1709031

Is possible to post un private post my login access here ?

TY

#1709733

Waqar
Supporter

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

Thank you for sharing these details.

I'm afraid, as the Blocks based views can't be nested at the moment, both the views will need to be created using the classic editor.

You're welcome to share temporary admin login details in reply to this message so that I can see how everything is set up and suggest the next steps accordingly.

Note: Your next reply will be private and please make a complete backup copy, before sharing the access details.

#1711139

Hello,
Is ok ?

Ty 😉

#1711251
opignon.PNG

Hello,

Here is a capture in PJ that shows where to add reviews from companies that I can't seem to include.

Thanks again 😉

#1712227

Waqar
Supporter

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

Hi Stéphane,

Thank you for sharing the admin access and I'm able to login successfully.

I'll be reviewing how the content template and the views are set up on your website and will perform some testing on my own website, to suggest the most efficient way to achieve this.

Thank you for your patience.

regards,
Waqar

#1712351

Great, thank you very much !

I don't know if I can help you but if need I'm available on skype on stephane.madaleno or meet on stephane.madaleno@gmail.com 😉

Thanks again ! I can't wait

#1713377

Hello,

How are you today?
If it can save you time, you can make changes directly on the site. I made a backup, you can do what you want.

Thank you for your feedback because it is really urgent for me to launch this site.

I am ready to pay or find a solution but I really need the reviews to appear directly in the company listing.

Thank you and have a nice day.

Stéphane

#1714307

Waqar
Supporter

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

Hi Stéphane,

Thank you for waiting.

I was able to show the list of all related "Les Avis" posts, inside the "Entreprises" block.
( screenshot: hidden link )

1. I created a new view named "View to show Les Avis related to Entreprises" using the classic editor and set it to show the "Les Avis" posts.

A post-relationship query filter was also added to show only posts related to the "Entreprises" post, whose ID is passed as a shortcode attribute "wpvrelatedto".
( screenshot: hidden link )

Note: For demonstration purposes, I've only added the post title and ID in this view's loop item content, but you're welcome to show any field data from the relevant "Les Avis" post, as needed.
( screenshot: hidden link )

2. Next, the shortcode of this new view was inserted in the content template for single "Villes" post:
( screenshot: hidden link )


[wpv-view name="view-to-show-les-avis-related-to-entreprises" wpvrelatedto="[wpv-post-id]"]

Shortcode references:
wpv-view:
https://toolset.com/documentation/programmer-reference/views/views-shortcodes/#wpv-view

wpv-post-id:
https://toolset.com/documentation/programmer-reference/views/views-shortcodes/#wpv-post-id

I hope this helps and please let me know if you need any further assistance around this.

regards,
Waqar

#1716045

Great, thank you ! It works perfectly!
I will talk about your plugin at my next conference. It is excellent.

A big thank you to your team!

#1718647

Hello,

I have a problem with the view display. Sometimes it shows up and sometimes it doesn't. In addition, the edition of the templat is very slow.

Each time I get the message "rocessing server request, please wait ..." non stop ...
hidden link

Can you disable this process when editing the template?

I gave you the access. These are the same as those sent.

hidden link I can no longer display comments with your view and display them.

It worked at first but I have the impression that since importing a larger quantity it no longer appears.

Sometimes I had to save multiple times for it to work. But now I can't display it at all.

Thank you

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