Skip Navigation

[Resolved] Unordered list of taxonomy terms associated with the current post

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

Problem: I would like to show a list of terms associated with the current post. I am currently using the wpv-post-taxonomy shortcode, but it does not allow me to create a fully formatted unordered list.

Solution: Create a View of this taxonomy, filtered by taxonomy term, where the term is set by the current page or post where this View is shown. In the Loop Output editor, create an unordered list that displays each term using the wpv-taxonomy-title shortcode.

Relevant Documentation:
https://toolset.com/documentation/user-guides/filtering-views-by-taxonomy/
https://toolset.com/documentation/user-guides/digging-into-view-outputs/
https://toolset.com/documentation/user-guides/views-shortcodes/#wpv-post-taxonomy
https://toolset.com/documentation/user-guides/views-shortcodes/#wpv-taxonomy-title

This support ticket is created 5 years, 11 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
8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 - -
13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 - -

Supporter timezone: America/New_York (GMT-04:00)

This topic contains 13 replies, has 2 voices.

Last updated by peterB-20 5 years, 10 months ago.

Assisted by: Christian Cox.

Author
Posts
#902204
2018-05-22 21_15_00-Edit Content Template ‹ VDS — WordPress.png
2018-05-22 21_12_36-Andrea Lagerwey - VDS.png

I am creating a page based on data from just one custom post type.
Content template based on Divi
One of the outputs is based on a taxonomy with multiple entries "Specialism" (like personal skills)
Instead of the separator I like to have a unnumbered list to improve the readability

No, can't find any documentation

retiaculum.nl (= a development copy of woodwalker.nl to test in without ruining the original one)

Thx

#902230

Hi, instead of using a wpv-post-taxonomy shortcode, you can create a new View of the "Specialisme" taxonomy, filtered by term, where the term is set by the current post. In the View's Loop Output editor, use the Loop Wizard to create an unordered list that includes each term title or term link. Let me know if you have questions about this.

#902245
2018-05-22 23_33_45-Andrea Lagerwey - VDS.png

Hi,

Thx for your quick reply, I have tried that but overlooked the option of the unnumbered list. In stead of that I have added the

    and

  • codes in the loop.

    Nevertheless the output is same, so I am overlooking something I am afraid.
    The output is all the "specialism" data from the complete team, see screenshot.

    Please advice,
    Thx

#902249

Can you copy + paste the code from your Loop Output editor here for me to review?

Wrap your code in code tags so it is formatted correctly.

#902379

Okay, here it is. Thanks in advance. FYI, I am using Toolset 3.0-RC2

I have also found a bug in the loop wizard for Bootstrap grid and table-based grid (a </div> and a </tr> error), but I assume this is a known error. Let me know when you like to receive the details about this.


[wpv-layout-start]
	[wpv-items-found]
	<!-- wpv-loop-start -->
	<ul class="wpv-loop js-wpv-loop">
		<wpv-loop>
			<li>
				[wpv-post-taxonomy type="specialisme" format="name"]
			</li>
		</wpv-loop>
	</ul>
	<!-- wpv-loop-end -->
	[/wpv-items-found]
	[wpv-no-items-found]
		<strong>[wpml-string context="wpv-views"]No items found[/wpml-string]</strong>
	[/wpv-no-items-found]
[wpv-layout-end]

#902440

Use the wpv-taxonomy-title shortcode inside the loop to display the term name:

[wpv-layout-start]
    [wpv-items-found]
    <!-- wpv-loop-start -->
    <ul class="wpv-loop js-wpv-loop">
        <wpv-loop>
            <li>
                [wpv-taxonomy-title]
            </li>
        </wpv-loop>
    </ul>
    <!-- wpv-loop-end -->
    [/wpv-items-found]
    [wpv-no-items-found]
        <strong>[wpml-string context="wpv-views"]No items found[/wpml-string]</strong>
    [/wpv-no-items-found]
[wpv-layout-end]

I have also found a bug in the loop wizard for Bootstrap grid and table-based grid (a </div> and a </tr> error), but I assume this is a known error.
Please create a separate ticket for this issue so we can make sure it is resolved in the upcoming releases.

#902490
2018-05-23 15_49_55-Edit View ‹ VDS — WordPress.png
2018-05-23 15_47_00-Edit Team ‹ VDS — WordPress.png
2018-05-23 15_45_20-Maarten Tigchelaar - VDS.png

Unfortunately this not yet the solution, the unnumbered list there but empty. see screenshots.

I will create a seperate ticket for the assumed bug.

Thx

#902507

I see 5 Specialisme terms associated with this post, but 6 list items in the screenshot. Something else must be going on, because these numbers should be identical. Can you please take a screenshot of the View editor screen and share it here?

#902517

Sorry, my mistake I was not clear about this.
Well actually it is a list of about 30 bullets, see hidden link
The screenshot only shows 6 of these, I assume the bullets equals the number of team members.

* total team members: 49
* total bullets : 46 (maybe 3 members without any specialism)

But ...what do you mean with the vie editor screen?

#902591
view-editor.jpg

* total team members: 49
* total bullets : 46 (maybe 3 members without any specialism)

I'm sorry, I still don't understand how your post types and taxonomy terms and Views are configured. I think it might be best for me to log in to your wp-admin area and see how this is set up. If that's okay with you, please provide login credentials in the private reply fields here.

If you cannot share login credentials, please go to Toolset > Views and edit the View or Views used to display this list. Take a screenshot of the entire View Editor screen, like I have attached here.

#902924

Okay thanks. Please look at this View:
hidden link

I can see that this is a View of the post type "Teams". I don't think that is correct, because this list should not show Teams. It should show only the Specialisme Taxonomy terms associated with the Maarten Tigchelaar team. So you should change the "Content Selection" of this View to be "This View will display: Taxonomy Specialisme", and you should add a Query Filter to filter by taxonomy term, where the term is set by the current post.

This will show a list of Specialisme terms associated with the current Team - Maarten Tigchelaar. There are currently 5 terms in wp-admin, so the list should include 5 terms:
- 70-20-10 methodiek
- L&D organisatie efficiency
- Organisatie leervraagstukken
- Out of the box leeroplossingen
- Talent en Management Development

If this is not what you expect, please give me some more details about what you expect to see in the list.

#904085

Perfect thx a lot so far. I'll check it with "blog" and when it works there too I will close the issue.

Tomorrow I post the assumed bug in the loop wizard.

Thx again,
Cheers
Peter

#904533

Great, let me know what you find.

#909303

Perfect now. Thx for your help.

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