Skip Navigation

[Resolved] Dynamic Taxonomy Archive Page

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.

This topic contains 14 replies, has 3 voices.

Last updated by joelW-3 1 month, 1 week ago.

Assigned support staff: Minesh.

Author
Posts
#1735375

I am trying to create a taxonomy archive template that will display a consistent layout for each associated custom post type, but will also display dynamic information based on the taxonomy value selected by the user. My custom post type is "Courses" My Taxonomy is "Course Categories" An example of a taxonomy value might be "Adobe", while corresponding post types would be Photoshop Training, InDesign Training, Illustrator Training, etc. I'd like to create a layout that lists all of the corresponding courses for a specific taxonomy value but also add some additional information (static and dynamic) to the template for each specific taxonomy value (Adobe, Microsoft, etc.)

I followed the documentation for created custom taxonomy archives successfully - but that only displays the associated post types, and I'd like to add more to each page. I don't want to create a custom page for each Taxonomy value and use a view because that will duplicate the taxonomy archive created automatically by WordPress and, in addition to not knowing how to disable that) I'd like to use it as is - it matches my current sites URL structure.

Here is an example of what I am trying to achieve: hidden link The Course Category would be Adobe, the Courses listed on the page would be associated Custom Post Types but the other information would be either static (and specific) to just Adobe courses (like the paragraph at the top) or dynamic (like the associated blog posts or videos on Adobe) For Microsoft, and other Taxonomy values it would need to change. Is there a way to create this in Toolset? I can create the basic Archive template to display for each Taxonomy value and list the courses, but can't figure out how to make each result specific to the taxonomy value chosen (I understand that the value of a template is for pages that will have the same output - but I guess I'm trying to create a hybrid of template and custom content?) Perhaps I'm not approaching it correctly!

#1735993

Jamal
Supporter

Languages: English (English ) French (Français )

Timezone: Africa/Casablanca (GMT+01:00)

Hello and thank you for contacting the Toolset support.

WordPress archives are dynamic pages that are pulled from the database. For taxonomy archives, they can also pull term fields. This being said, I would like to ask what is the static content that you intend to put on the archive template? Can this data be stored in the database(term fields, for example) and get pulled?

You can also put views inside archive templates, but we currently have a limitation on AJAXified views. AJAX can't be enabled on views inside an archive template.

Depending on how you build the archive templates, using the block editing experience, or the legacy editor, you can conditionally display content depending on what term is this archive, this way you can put different elements for the terms "Adobe" and "Microsoft".

I hope this answers your requests. Let me know if you have any other questions. Let me know if you started building an archive and you felt stuck on something.

#1736041

Thank you for the quick reply, Jamal. Based on your answer, it sounds like Term fields for Taxonomies is what I am looking for. That way (if I'm understanding correctly) I can add custom values to each Taxonomy value that I create and then display those values on the front-end when that Taxonomy is selected. Have I got that right? If so, I will try that out today and let you know if I run into any problems. Thanks again!

#1736257

Hi - I tried to go through the steps to add Term fields for my custom taxonomy and display them in my taxonomy archive page using the instructions found here: https://toolset.com/documentation/user-guides/views/term-fields/ and here: https://toolset.com/documentation/user-guides/views/displaying-wordpress-term-fields/

I was able to add a couple of Term fields in a field group and associate it with my taxonomy. I'm also able to fill the values in with data and save it. But when I go to add those field values to my taxonomy archive template, they do not appear when I click on "Fields and Text." I tried to add a view to the taxonomy archive page and put them there, but I get an error when I do that that nested views are not allowed. Not sure what I am doing wrong or if I am going about this the wrong way. My taxonomy structure looks like this:

Adobe
- Acrobat Training
- Photoshop Training
- InDesign Training

When the user goes to [mysiteurl]/course-categories/adobe I'd like them to see the "children" listed out on the page (which I am able to do in a loop successfully) but then I'd also like the Description and Image term fields for "Adobe" (not the children) listed at the top of the page. Like my example of hidden link

I've attached some screen shots to show you what I have done so far. Thanks again for your help.

#1736293

Jamal
Supporter

Languages: English (English ) French (Français )

Timezone: Africa/Casablanca (GMT+01:00)

Would it be possible to allow me temporary access to your site to check it closely? If yes, your next reply will be private to let you share credentials safely. ** Make a database backup before sharing credentials. **

If it is not possible, I would like to know how are you building the archive template? Using Blocks or the legacy editor?
I can also create a new installation on our platform and we can work on it together to show how this can be done.
Let me know what you would prefer.

#1736295

Unfortunately I'm building it on my local machine using Local Hub so I don't think there is a way for me to let you login. If a Zoom or Teamviewer session is possible I can definitely let you see what I have. Just let me know. I believe I am using the Block Editor for the Archive page. Attached is where I am going to edit it. If I'm not able to show you what I'm doing, just let me know what info you need from me to create something. Thank you so much for the help!

#1736705

I've recreated what I'm doing on a site I can give you credentials to if you can resend me the request. Thanks.

#1737273

Jamal
Supporter

Languages: English (English ) French (Français )

Timezone: Africa/Casablanca (GMT+01:00)

Of course, your next reply will be private to let you share credentials safely.
It would be helfpul if you prepare the required data and if you explain what should be displayed? and when?

#1737595

Hi Jamal - it didn't give me the same private reply box to enter my credentials.

#1738241

Hi Jamal - could you send me the request for my credentials? The last reply didn't give me the option of supplying them privately. Also I have attached a screenshot of the type of page I am trying to build. My custom Taxonomy is Course Categories. My custom type is Course. Each Course will belong to a Taxonomy. For example, Adobe InDesign Training will belong to the Adobe Training taxonomy. I created a custom archive page for Course Categories and I am able to loop through the Courses that belong to that Taxonomy, but I am not able to output my custom Taxonomy Term values on the template. So, for instance it should show the description for Adobe Training Classes on the Adobe Course Categories archive page, but should show the description for Microsoft Training classes on the Microsoft Course Categories archive page. Thanks again for your help.

#1739089

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Jamal is on Vacation. This is Minesh here and I'll take care of this ticket. Hope this is OK.

If you dont mind can you please share your actual issue details tell me what you want to fix and share problem URL.

I have set the next reply to private which means only you and I have access to it.

#1741965

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Thank you for sharing access details and all required information.

Toolset Blocks do not support Taxonomy and User views. As well as, nested views are not supported yet.

I've workaround to share using the classic view - where, we can create the taxonomy view using classic view and within the taxonomy view add the required custom term fields and display the taxonomy view using the "Fields and Text" block.

you can check here I've added the taxonomy view using "Fields and Text" block at top of the archive:
=> hidden link

And created the following taxonomy view in classic view mode:
=> hidden link

More info:
=> https://toolset.com/2019/12/using-toolset-blocks-on-existing-toolset-sites/

#1742117

Thank you, Minesh. It looks like this is doing what I need so that is a great start for me to work off of. Are there any plans to support this functionality without using Classic Views in the near future?

#1742119

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Yes - We do have plans but we do not have any ETA on it.

But those features should be added to Toolset Blocks in near future.

#1742221

Thanks, Minesh.