Skip Navigation

[Resolved] Is there a way to show a taxonomy term field (image) in a view using blocks?

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

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
- 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 -
- 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 -

Supporter timezone: Europe/London (GMT+00:00)

This topic contains 7 replies, has 2 voices.

Last updated by RensV5812 4 years, 11 months ago.

Assisted by: Nigel.

Author
Posts
#1405283

Tell us what you are trying to do?
Show a taxonomy term field in a view.
Is there any documentation that you are following?
https://toolset.com/documentation/user-guides/custom-content/displaying-wordpress-term-fields/
Is there a similar example that we can see?
-
What is the link to your site?
hidden link

#1405363

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+00:00)

Screenshot 2019-12-11 at 09.18.47.png

To output taxonomy term custom fields you need a View that queries the taxonomy.

In the first release of Blocks only post Views are supported, not taxonomy (nor user) Views.

So you would need to create such a View using classic Views editor.

If you installed Blocks, the classic editor is disabled by default, but you can go to Toolset > Settings and change this under Editing experience.

#1405415

Hi Nigel,

Thanks for the reply. I think I'll be okay now. 🙂

Rens

#1405653
Taxonomy view not showing.png

For some reason my view of the taxonomy is nog showing properly. When I try to select it it gives me this error:
"Error while retrieving the View preview. The selected View (ID: undefined) was not found."

When I try to add the view to a static page with Elementor Pro it works fine.

Any clue what I'm doing wrong?

#1405923

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+00:00)

Actually, you are not doing anything wrong, that's a known issue that will be addressed in a subsequent update.

For now, as a workaround, you can insert the View using a block that accepts shortcodes, such as the Custom HTML block.

But you will need to manually type the wpv-view shortcode, there is no "Field and Views" button available in that situation.

What's the name of your View?

The shortcode would be something like this:

[wpv-view name="my-taxonomy-view"]

Can you try that?

#1405931

Thanks, that works. One more thing, how do now get only the image of the taxonomy of the current item in the loop? Now I have all the taxonomy images showing up for each item in the loop.

Here's the code for my taxonomy view:

[wpv-layout-start]
	[wpv-items-found]
	<!-- wpv-loop-start -->
		<wpv-loop>
          [types termmeta='categorie-afbeelding' title='%%TITLE%%' alt='%%ALT%%' size='medium' resize='proportional'][/types]
		</wpv-loop>
	<!-- 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]
#1405943

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+00:00)

You need to add a Query Filter to your taxonomy View where the term is set by the current post in the Loop (the text may be different, could refer to the parent View, if it is not clear ask and I will double-check).

#1405953

Yep, I got it now!

Still trying to get a hang of the plugin but appreciate the support from you guys.

Cheers,
Rens