Skip Navigation

[Resolved] Displaying Tags into Tables with rows and columns

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

Problem: I would like to display the tags associated with the current post, but I would like to arrange the tags in a table.

Solution: Create a View of the taxonomy filtered by term, set by the current post. Then use the Loop Wizard to build the display you would like.

Relevant Documentation:
https://toolset.com/documentation/user-guides/view-layouts-101/
https://toolset.com/documentation/user-guides/digging-into-view-outputs/

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

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
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 10 replies, has 2 voices.

Last updated by jamesS-14 5 years, 7 months ago.

Assisted by: Christian Cox.

Author
Posts
#1223492
tags tables screenshot toolset.png

Hi I have a dropship directory website with lots of companies (wholesalers, dropshippers, etc.). I have created most of my Content Template for each supplier but I was wondering if it was possible to display the Tags of each individual supplier into a Table (with even rows/columns) instead of separating each tag with a "," or something like that (see attachment)? You'll notice I have a table for the company's full profile but I can't figure out how to show the tags in a table format so it doesn't look so unorganized. I am looking to display the suppliers' specific products (product type, brand name, etc.) as the Tags but have it appear in a table so it's easier to read. Please help. Thank you!

#1223548

Hi, instead of using the wpv-post-taxonomy shortcode to display a list of terms associated with the current post, you can create a View of the Tags taxonomy and add a Query Filter. Set the Query Filter to filter by term, set by the current post. Then using the Loop Wizard you can create a table or a Bootstrap grid to display the terms associated with the current post (if your theme is compatible with Bootstrap). If you need more detailed information about creating this type of display in the Loop Wizard, we have more information available here:
https://toolset.com/documentation/user-guides/view-layouts-101/
https://toolset.com/documentation/user-guides/digging-into-view-outputs/

#1223585
IMG 2 - notes section screenshot.png
IMG 1 - tags favorites screenshot.png

Ok thanks for the fast reply. But now each tag inside the table includes the "Save This Supplier" favorites button (see IMG 1 attachment). I only want that button to display once on that page instead of in each tag. Can you help me fix that?

On another note, one of my rows has "Notes" about the Supplier. Some suppliers don't have any notes in that section (see IMG 2 attachment). You will notice that it's just a blank section for the suppliers without any notes. Is there a way to completely hide that row for the suppliers who don't have any notes? Looking forward to your reply. Thanks!

#1223604

But now each tag inside the table includes the "Save This Supplier" favorites button (see IMG 1 attachment). I only want that button to display once on that page instead of in each tag. Can you help me fix that?
How is that button added to the View? If it's a shortcode you inserted in the loop or template, you should remove it and add it outside the loop.

Is there a way to completely hide that row for the suppliers who don't have any notes?
You can check out our documentation for conditional HTML here: https://toolset.com/documentation/user-guides/conditional-html-output-in-views/
If you need more detailed information, feel free to open a separate ticket so we can discuss. Our policy is one topic per ticket, to help keep things organized. Thanks!

#1223615
Favorites plugin - IMG 2.png
Favorites plugin - IMG 1.png

The "Save This Supplier" button comes from the FAVORITES plugin I installed to allow users to save supplier(s) they like. The website to the plugin is hidden link in case you wanted to see it. I attached 2 screenshots of what it looks like inside my wordpress admin so you can see the options it gives me. You'll notice I selected the option that says "include after content"...that way the button will appear at the bottom of each specific supplier page. I just don't want it to appear inside each tag within the table.

#1223950

Okay thanks. Can you copy + paste the contents of your View's loop editor panel here for me to review? I might be able to suggest a change to suppress these buttons in the View.

#1224101

The contents I have in the View's Loop editor panel are below:
[wpv-layout-start]
[wpv-items-found]
<!-- wpv-loop-start -->
<wpv-loop wrap="3" pad="true">
[wpv-item index=1]
<div class="row ">
<div class="col-sm-4">[wpv-post-body view_template="loop-item-in-tags-view-test"]</div>
[wpv-item index=other]
<div class="col-sm-4">[wpv-post-body view_template="loop-item-in-tags-view-test"]</div>
[wpv-item index=3]
<div class="col-sm-4">[wpv-post-body view_template="loop-item-in-tags-view-test"]</div>
</div>
[wpv-item index=pad]
<div class="col-sm-4"></div>
[wpv-item index=pad-last]
<div class="col-sm-4"></div>
</div>
</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]

And the contents I have in my Content Template editor are below:
<h1 style="margin-bottom:0px;border-top:2px solid #5E5E5E;border-left:2px solid #5E5E5E;border-right:2px solid #5E5E5E;border-bottom:1px solid #5E5E5E;border-top-left-radius: 8px;border-top-right-radius: 8px;background-color:#909090;color:#ffffff;"><center>[wpv-post-title]</center></h1>

[su_table responsive="yes"]<table style="width:100%;text-align:left;background-color:#EBEBEB !important;border-right:1px solid #ffffff !important;font-family:sans-serif;font-size:14px;">
<tr>
<td style="width:25%;background-color:#EBEBEB !important;color:#5E5E5E;padding:7px;border-bottom:1px solid #FBFBFB !important;">Address</td>
<td style="width:75%;background-color:#ffffff;color:#5E5E5E;padding:7px;border:1px solid #EBEBEB !important;">[types field='address'][/types]</td>
</tr>
<tr>
<td style="background-color:#EBEBEB !important;color:#5E5E5E;padding:7px;border-bottom:1px solid #FBFBFB !important;">Website</td>
<td style="background-color:#ffffff;color:#5E5E5E;padding:7px;border:1px solid #EBEBEB !important;">[types field='supplier-website' target='_blank'][/types]</td>
</tr>
<tr>
<td style="background-color:#EBEBEB !important;color:#5E5E5E;padding:7px;border-bottom:1px solid #FBFBFB !important;">Contact</td>
<td style="background-color:#ffffff;color:#5E5E5E;padding:7px;border:1px solid #EBEBEB !important;">[types field='supplier-contact-us-page' target='_blank'][/types]</td>
</tr>
<tr>
<td style="background-color:#EBEBEB !important;color:#5E5E5E;padding:7px;border-bottom:1px solid #FBFBFB !important;">Email</td>
<td style="background-color:#ffffff;color:#5E5E5E;padding:7px;border:1px solid #EBEBEB !important;">[types field='supplier-email' separator=' <br />'][/types]</td>
</tr>
<tr>
<td style="background-color:#EBEBEB !important;color:#5E5E5E;padding:7px;border-bottom:1px solid #FBFBFB !important;">Phone</td>
<td style="background-color:#ffffff;color:#5E5E5E;padding:7px;border:1px solid #EBEBEB !important;">[types field='supplier-phone' separator=' <br />'][/types]</td>
</tr>
<tr>
<td style="background-color:#EBEBEB !important;color:#5E5E5E;padding:7px;border-bottom:1px solid #FBFBFB !important;">Fax</td>
<td style="background-color:#ffffff;color:#5E5E5E;padding:7px;border:1px solid #EBEBEB !important;">[types field='supplier-fax'][/types]</td>
</tr>
<tr>
<td style="background-color:#EBEBEB !important;color:#5E5E5E;padding:7px;border-bottom:1px solid #FBFBFB !important;">Shipping Region</td>
<td style="background-color:#ffffff;color:#5E5E5E;padding:7px;border:1px solid #EBEBEB !important;">[types field='supplier-shipping-region'][/types]</td>
</tr>
<tr>
<td style="background-color:#EBEBEB !important;color:#5E5E5E;padding:7px;border-bottom:1px solid #FBFBFB !important;">Shipping Method</td>
<td style="background-color:#ffffff;color:#5E5E5E;padding:7px;border:1px solid #EBEBEB !important;">[types field='supplier-shipping-method'][/types]</td>
</tr>
<tr>
<td style="background-color:#EBEBEB !important;color:#5E5E5E;padding:7px;border-bottom:1px solid #FBFBFB !important;">Approved For</td>
<td style="background-color:#ffffff;color:#5E5E5E;padding:7px;border:1px solid #EBEBEB !important;">[types field='approved-for' state="checked" option="0"]✔ Ebay[/types][types field='approved-for' state="unchecked" option="0"]❌ Ebay[/types] <br />[types field='approved-for' state="checked" option="1"]✔ Amazon[/types][types field='approved-for' state="unchecked" option="1"]❌ Amazon[/types] <br />[types field='approved-for' state="checked" option="2"]✔ Online Store[/types][types field='approved-for' state="unchecked" option="2"]❌ Online Store[/types]
</tr>
<tr>
<td style="background-color:#EBEBEB !important;color:#5E5E5E;padding:7px;border-bottom:1px solid #FBFBFB !important;">Supplier Type</td>
<td style="background-color:#ffffff;color:#5E5E5E;padding:7px;border:1px solid #EBEBEB !important;">[types field='supplier-type' state="checked" option="0"]✔ Dropshipper[/types][types field='supplier-type' state="unchecked" option="0"]❌ Dropshipper[/types] <br />[types field='supplier-type' state="checked" option="1"]✔ Wholesaler[/types][types field='supplier-type' state="unchecked" option="1"]❌ Wholesaler[/types] <br />[types field='supplier-type' state="checked" option="2"]✔ Affiliate[/types][types field='supplier-type' state="unchecked" option="2"]❌ Affiliate[/types]
</tr>
<tr>
<td style="background-color:#EBEBEB !important;color:#5E5E5E;padding:7px;">Notes</td>
<td style="background-color:#ffffff;color:#5E5E5E;padding:7px;border:1px solid #EBEBEB !important;">[types field='notes'][/types]</td>
</tr>
<tr>
<td colspan="2" style="background-color:ffffff;padding-top:20px !important;padding-bottom:20px !important;">[wp-svg-icons icon="warning" wrap="i"] Problem with the Supplier? Click here to let us know.</td>
</tr>
</table>[/su_table]

[su_spoiler title="Notes" open="yes" style="fancy" icon="caret"]<font style="color:#5E5E5E;font-family:sans-serif;font-size:14px;">[types field='notes'][/types]</font>[/su_spoiler]

[su_spoiler title="Products" open="yes" style="fancy" icon="caret"]<font style="color:#5E5E5E;font-family:sans-serif;font-size:14px;">[wpv-post-taxonomy type="post_tag" format="name"]</font>[/su_spoiler]

[wpv-view name="tags-view-test"]

#1224114

You can try adding suppress_filters="true" to each wpv-post-body shortcode in the loop:

[wpv-post-body view_template="loop-item-in-tags-view-test" suppress_filters="true"]

If this doesn't solve the problem, I'll have to take a closer look.

#1224198

Sorry I’m not sure what you mean. Where would I copy and paste that shortcode you just gave me? Would I put it in the VIEWS Loop Wizard or the CONTENT TEMPLATE? Also where would I post it? I’m not sure what you mean when you say to add suppress_filters=“true” to each wps-post-body shortcode. What part is considered to be a wps-post-body shortcode in my document? Sorry I’m somewhat new to html and css and shortcodes and all that. I copied/pasted that full shortcode you gave at the bottom of both VIEWS Loop Wizard and the CONTENT TEMPLATE but that didn’t seem to do the trick so maybe I am misunderstanding what you said to do. Thanks!

#1224254

Actually I was able to figure out what you meant so it works now. I will go ahead and switch the ticket status to "Resolved" and I will open a new ticket with my other question I heard earlier in my other message. Thanks for your help!

#1224255

My issue is resolved now. Thank you!