Skip Navigation

[Resolved] How to display posts grouped by relationship belongs to.

This support ticket is created 4 years, 5 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 4 replies, has 2 voices.

Last updated by Waqar 4 years, 5 months ago.

Assisted by: Waqar.

Author
Posts
#1715431

Tell us what you are trying to do?
I want to display some articles organize like this:
- Article (Name)
- Section (Name, belongs_to Article)
- Subsection (Name, content, belongs_to Section)

I want to display a list if possible on an accordion with all the Sections with its subsections. I tried to create a view with a loop with all Sections and then add another one called subsections but It was not possible. Toolset blocks displayed a warning "Nested views not available at the moment" something like that.

What would be the best way to create this?

Is there any documentation that you are following?
https://toolset.com/documentation/user-guides/views/using-a-child-view-in-a-taxonomy-view-layout/

Is there a similar example that we can see?
hidden link

What is the link to your site?
nueva.ambu.mx

#1715501
Screen Shot 2020-07-22 at 20.54.52.png

This is what happened? And then I was not able to stop the script from trying.

#1715609

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, as explained in the documentation, you referred to:
https://toolset.com/documentation/user-guides/views/using-a-child-view-in-a-taxonomy-view-layout/

Note: 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.

After that, you'll see the views management screen at WP Admin -> Toolset -> Views, from where you'll be able to create views using the classic editor.

I hope this helps and please let me know if you face any difficulty in creating or nesting these views. You're also welcome to share temporary admin login details, in reply to this message, so that I can see what is already set up and what's missing.

Note: Your next reply will be private and though no changes will be made on your website, please make a complete backup copy, before sharing the access details.

regards,
Waqar

#1716685

Could someone please review this request?

#1716833

Thanks for the update and glad that you've managed to make the nested views work.

I can understand your concern about the documentation. Since we're transitioning from the classic editor to the blocks editor, the documentation is also getting fully revamped and restructured. As more features like nested views will become available within the blocks editor, there will be no need to switch to the classic one.

> Now how can I make the title a link to the current item (item's title)
- In both your views, the "[wpv-post-title]" shortcode is being used, which shows the current item's title.

For the current item's title with a link, you can use the "[wpv-post-link]" shortcode, instead:
( ref: https://toolset.com/documentation/programmer-reference/views/views-shortcodes/#wpv-post-link )

> Could you please explain me or point me to the use of view section?
- If you'd like to understand, how the view's output works, when using the classic editor, you'll find the following guides useful:

https://toolset.com/documentation/legacy-features/views-plugin/view-layouts-101/
https://toolset.com/documentation/user-guides/views/digging-into-view-outputs/

For any other specific section or element, please share a screenshot and I'll explain accordingly.

> Could you please explain me how to add links to mi current loop which is a view inside another view?
- While creating/editing a view using the classic editor, you'll see the "Fields and Views" button above all content input boxes.
( screenshot: hidden link )

You can use it to either visually pick the information item that you want to insert or use the available shortcodes directly.
( ref: https://toolset.com/documentation/programmer-reference/views/views-shortcodes/#wpv-post-link )

> Could you please explain me how to add styles to that views? Can I add them in the page where I am using the view or in the view page?
- You'll find the "CSS editor" and "JS editor" tabs under the "Loop Editor" section's loop and loop item input boxes.
( screenshot: hidden link )

You can include your custom CSS and JS code in those tabs, respectively and that custom code will be loaded on all pages where this view will be called.

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