Skip Navigation

[Resolved] Taxonomies Parent Child as Drupal Books

This thread is resolved. Here is a description of the problem and solution.

Problem:

Display posts on three level Hierarchical Taxonomy.

Solution:

It needs a nested view, see detail steps here:

https://toolset.com/forums/topic/taxonomies-parent-child-as-drupal-books/#post-1155966

Relevant Documentation:

https://toolset.com/documentation/user-guides/using-a-child-view-in-a-taxonomy-view-layout/

This support ticket is created 6 years 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.

No supporters are available to work today on Toolset forum. Feel free to create tickets and we will handle it as soon as we are online. Thank you for your understanding.

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)

Author
Posts
#1153053

First of all Toolset is soooo wonderful...I'm not a developer so UI is sooo important which we found in Toolset..

- Tell us what you are trying to do?
We are migrating from Drupal to WordPress & bought Toolset to fulfill the same as Drupal is doing:
hidden link
Accordion view of Main Page then it contains A title
Page: Articles--->>> (Navigation Bar Tab)
Title: 1. Title (e.g. How to Begin A Relationship with God)--->>>
Subtitle: 1.1 Subtitle (e.g. New Birth) --->>>
Articles: Article 1 (e.g. Jesus the Saviour)
Article 2 (e.g. How to be Born Again from God)
Article 3 (e.g. After Being Born Again)

Title: 2. Title (e.g. The Holy Spirit)--->>>
Subtitle: 2.1 Subtitle (e.g. Who is the Holy Spirit) --->>>
Articles: Article 1 (e.g. Comforter)
Article 2 (e.g. Helper)
Article 3 (e.g. Encourager)

Well, all the titles & subtitles & articles are linked to open the item itself in separate page...inside the Articles Main Page.
We have hundreds of posts (articles) moved from Drupal.

Well we put more than a taxonomy for our posts...my team is sorting them Article Sermon...etc.

We want to use the best of Toolset...how to fulfill the above I'm swimming in the Documentations that are very good..but still wasn't reaching how to be done.
We tried Views, Layouts, Archives...but nothing fulfilled what we want:

I have been able to show some articles with the following: Title, Author, Category...which wasn't in the Drupal (we currently use)

- Is there any documentation that you are following?
No

- Is there a similar example that we can see?
hidden link
Kindly use Google Translate for it's in Arabic
We have similar in English but the level of Children is just one level...in the Arabic there's 3rd generation but you can have a look:
hidden link

What is the link to your site?
hidden link
This is the WordPress not live now...we migrated & sorting it by Toolset.

#1153558

Hello,

I suggest you follow our documents to migrate your website data from Drupal to WordPress.
https://toolset.com/learn/guide-drupal-developers-switching-wordpress/

In Toolset side, you can setup:

- custom post types:
https://toolset.com/documentation/user-guides/create-a-custom-post-type/

- custom taxonomies
https://toolset.com/documentation/user-guides/create-custom-taxonomies/

If you need a custom Hierarchical taxonomy, please check above document, section "Hierarchical and Non-Hierarchical Taxonomy":
https://toolset.com/documentation/user-guides/create-custom-taxonomies/#taxonomy-types

This will be able to get a parent/child terms relationship, just like wordpress built-in taxonomy "Category".

- custom fields:
https://toolset.com/documentation/user-guides/using-custom-fields/

And display post types/taxonomies/custom fields in front-end with Views and Layouts
https://toolset.com/documentation/user-guides/display-lists-of-posts-and-create-custom-searches/
https://toolset.com/documentation/user-guides/layouts/

#1153626
890A424F-C712-4DF0-9498-99432B23975B.png

Sir I went through all of these...tried for days.
Here is what I did:
1. Migrated contents from Drupal they are now as Posts
2. Created taxonomies for the migrated contents...
- Categories: Sermons, Articles, Kids, Youth
- Language: Arabic , English
- Subjects: Salvation, Holy Spirit, Faith, Love
Subjects’ taxonomies has children Taxonomies as subtitles mentioned above...e.g. Salvation has children, Holy Spirit has children...etc.
3. Created many views using the mentioned Taxonomies, but couldn’t show the Tree hierarchy as Drupal was.

I want the page entitled Artilces/Sermons to show the:
Subjects Taxonomies in hierarchrial way including both Articles & Sermons for each Subject.

Articles/Sermons
Salvation....to show children taxonomies as titles, then when the visitor clicks on the children taxonomies will show the Posts that have been presorted under this child taxonomy whatever Sermon or Article
In views I tried to create Taxonomy, & post way...etc
I want the Taxonomy Subjects & its children appear as this way in the image please help me.
I was able to make Layouts Post, Author, Category

But I want the page to show hierarchy...please help me.

#1153636
9E5CEE26-4C6C-46D1-B3E0-FD6420298093.png

Contin.
This image is from the WordPress page after I added Taxonomies Subjects with children.
I want the Taxonomy
Subjects appear in a page as the following:
Child 1 (as a link) -> UNDER it Accordion or unordered list with its posts
Child 2 (as a link) -> UNDER it Accordion or unordered list with its posts
...etc.
Please tell me how for I tried MANY Views?

#1153691

For your question:

I want the page entitled Artilces/Sermons to show the:
Subjects Taxonomies in hierarchical way including both Articles & Sermons for each Subject.

How do you setup the "page entitled Artilces/Sermons"? Is it a normal wordpress page?

I assume we are talking about this case:
1) WordPress built-in post type "Posts"
2) A hierarchical taxonomy "Subject", and register to post type "Posts"
3) You are going to display the result in above page as below:
- Subject A
-- Post 1
-- Post 2
- Subject B
-- Post 3
-- Post 4
...

If it is, then it need a nested view, for example:
1) parent taxonomy view, query terms of custom taxonomy "Subject",
In the view's loop, display below child post view.

2) Child post view, query posts of post type "Posts", filter by:
Select posts with taxonomy:
Subject set by the parent Taxonomy View
https://toolset.com/documentation/user-guides/filtering-views-by-taxonomy/
and display the post links
See our document:
https://toolset.com/documentation/user-guides/using-a-child-view-in-a-taxonomy-view-layout/

If you need display the results in hierarchical format, you will need to add more taxonomy view in above nested view.
For example this thread:
https://toolset.com/forums/topic/display-hierarchical-taxonomies/#post-513060
For your reference.

#1154889

Million thanks dear.

Well I tried applying what you said & made a lot of trials.

Now I was able to show the Parents of the Taxonomies in my case "Subjects"

But I want to show more than a generation...I tried & was able to show only the Parents.

I want the following:
Parent Tax 1
-- Child Tax 1
--- Child Tax 1
--- Child Tax 2
-- Child Tax 2
--- Child Tax 1
--- Child Tax 2

Parent Tax 2
-- Child Tax 1
--- Child Tax 1
--- Child Tax 2
-- Child Tax 2
--- Child Tax 1
--- Child Tax 2

When I click on the Child tax in the 3rd generation I'll show the posts under it.

I tried this:
https://toolset.com/forums/topic/display-hierarchical-taxonomies/#post-513060

But seems that the code in the link wasn't the same as the Toolset Loop Wizard creates:

[wpv-layout-start]
[wpv-items-found]
<!-- wpv-loop-start -->
<ul class="wpv-loop js-wpv-loop">
<wpv-loop>

  • [wpv-post-body view_template="Loop item in Child Region"]
  • </wpv-loop>

    <!-- wpv-loop-end -->
    [/wpv-items-found]
    [wpv-no-items-found]
    [wpml-string context="wpv-views"]No items found[/wpml-string]
    [/wpv-no-items-found]
    [wpv-layout-end]

    I tried to replace the code as in the link but it repeated the parents...or showed them as not linked.

    I tried to embed the code of the Child Region still not showing the child taxonomies.

    I am glad I was able to show the Taxonomy's Parents...but I want to show
    1. Taxonomies' Children to to the 3rd generation
    2. To be accordion view...to collapse them.
    3. Also I want them hyperlinked (tax with link)
    4. Also I want to show Breadcrumb to help the user to navigate before & after the one he is in now.

    Same as in
    hidden link
    hidden link

    So I want your help again please.

    Thanks a lot.

    #1154984

    As I mentioned above, you need a child post view:
    https://toolset.com/forums/topic/taxonomies-parent-child-as-drupal-books/#post-1153691

    step 2) Child post view, query posts of post type "Posts",
    - filter by:
    Select posts with taxonomy:
    Subject set by the parent Taxonomy View
    - display the post information

    And put the child post view into parent taxonomy view's loop.

    See the document I mentioned above:
    https://toolset.com/documentation/user-guides/using-a-child-view-in-a-taxonomy-view-layout/

    If you need more assistance for it, please provide a test site with the same problem, also point out the problem page URL and view URLs, I can setup a demo for you

    #1155661
    Taxonomies.png

    Image to illustrate what I meant.

    #1155966

    Thanks for the details:
    I have done below modifications in your website:
    1) Edit the parent taxonomy view "Parent Tax for Subjects Ar":
    hidden link

    - query terms of taxonomy "Subjects مواضيع"
    - filter by:
    Select taxonomy terms whose parent is None.
    In the views loop, display below taxonomy view's (Step 2) shortcode:

    <li>Top level term [wpv-taxonomy-link]: [wpv-view name="subjects"]</li>
    

    2) Edit the child taxonomy view "Child Tax for Subjects Ar":
    hidden link

    - query terms of taxonomy "Subjects مواضيع"
    - filter by:
    Select taxonomy terms whose parent is the value set by the parent view.
    In the views loop, display below post view's (Step 3) shortcode:

    <li>2nd level term [wpv-taxonomy-link]: [wpv-view name="post-view-of-current-subjects-ar-term"]</li>
    

    3) Create a post view "Post view of current Subjects Ar term":
    hidden link

    - query posts
    - filter by:
    Select posts with taxonomy:
    Subjects مواضيع set by the parent Taxonomy View

    In the views loop, display posts links:

    [wpv-post-link]
    

    Please test it again, check if it is what you want:
    hidden link

    For your other questions:
    1) Collapsible accordion menu
    It needs custom JS codes, I suggest you follow Jquery UI document to setup the HTML codes and JS codes:
    hidden link

    If you need assistance for it, please create a new ticket for it.

    2) Also a Breadcrumb to show the user where is he on the site.
    That depends how do you setup the Breadcrumb in your website, I suggest you create another new ticket, and provide details for what you are going to achieve, thanks

    #1155971
    D0AA60ED-8AD2-44BC-B7FA-403CFB13F490.png

    Sir...I’m really so grateful that you saved me all of the efforts of 4 days trying....how wonderful this customer service is. I’ll recommend Toolset to many.

    Yes that’s what the way I wanted it to be shown on the page...Just one thing is remaining please:
    How to show the 3rd level the same way you showed the Top & 2nd Tax level? For we have 3rd level too.
    Noting please that there’re sometimes 2nd level Subjects.
    I mean this way
    - Top
    - - 2nd Level Term
    - - - ???? (This is missing)
    1. Posts
    2.
    Also on sorting my team was choosing the top, & 2nd & 3rd for one post thinking it’ll help on the search...but I this may cause posts appear in the 2nd & 3rd level.
    So kindly ignore this in case it happened...& I’ll tell them to revise all the posts to uncheck the ones & to check the only last level.

    Million thanks for the effort & help you did & do.
    I’ll check the JS as you said.
    Also I’ll create another level sir about the Breadcrumb.

    #1156023

    In your case, you can display the 2nd taxonomy view "Child Tax for Subjects Ar" in it's own loop, for example, edit "Child Tax for Subjects Ar" view:
    hidden link
    in section "Loop Editor", change the codes as below:

    ...
    <wpv-loop>
    			<li>Sub level term [wpv-taxonomy-link]
                  <hr />
                  Posts
                  [wpv-view name="post-view-of-current-subjects-ar-term"]
                  <hr />
                  Child terms:
                  [wpv-view name="subjects"]
              	</li>
    </wpv-loop>
    ...
    

    It should be able to work 3rd level terms and even 4th level terms, for your reference.

    #1156490

    My issue is resolved now. Thank you!
    Million thanks

    #1157349

    You are welcome.

    #1157639

    Dear I'm sorry to write again...
    The page isn't showing anything...results are blank.
    What is wrong? Still you can use the creds above to see
    hidden link

    hidden link

    I see may be because the WPML is installed now?? May be.
    Please help me.
    Thanks a lot.

    New threads created by Luo Yang and linked to this one are listed below:

    https://toolset.com/forums/topic/the-page-isnt-showing-anything-results-are-blank/

    #1157654

    Hi,

    I have created a new thread for your new question, please check the answers here:
    https://toolset.com/forums/topic/the-page-isnt-showing-anything-results-are-blank/