Skip Navigation

[Resolved] how to conditional display taxonomy term fields in Taxonomy Archive ?

The Toolset Community Forum is closed, for technical support questions, please head on to our Toolset Professional Support (for paid clients), with any pre-sale or admin question please contact us here.
This support ticket is created 6 years, 12 months ago. There's a good chance that you are reading advice that it now obsolete.
This is the community support forum for Types plugin, which is part of Toolset. Toolset is a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients and people who registered for Types community support can post in it.

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

Last updated by Christian Cox 6 years, 11 months ago.

Assisted by: Christian Cox.

Author
Posts
#590613

I had create a term fields: taxonomy-introduction2 , Field type: WYSIWYG.

I can display term fields in the taxonomy Archive using:

[types termmeta='taxonomy-introduction2'][/types] 

And I want to add a conditional checking: if is there any content in the term fields, display it in Taxonomy Archive

with following code:


 [wpv-conditional if="( [types termmeta='taxonomy-introduction2'][/types] ne '' )"] 

[types termmeta='taxonomy-introduction2'][/types]

 [/wpv-conditional] 

but it display nothing.

so how to improve and make it works ?

#591003

Hi, first, I apologize for the delay you experienced. It's not normal, and we're working to catch up quickly. WYSIWYG fields are a somewhat special case. You should add output='raw' to the field shortcode in a conditional clause:

[wpv-conditional if="( [types termmeta='taxonomy-introduction2' output='raw'][/types] ne '' )"] 

Please try this update and let me know if you continue to experience issues with this conditional.

#592584

hi, Christian,

I had try to use output="raw" before, but it is not working. Would help to give me more option to resolve this issues.

Thanks in advanced.

WilliamMei

#594817

You can try the conditional syntax below instead of the Types field shortcode, and apply debugging to see some additional information about the conditional. Please include the debugging information output on the screen if this does not achieve the desired results:

[wpv-conditional if="( $(wpcf-taxonomy-introduction2) ne '' )" debug="true"] 
[types termmeta='taxonomy-introduction2'][/types]
 [/wpv-conditional] 
#594935

Dear Cox,

following is debug information:

####################
wpv-conditional attributes
####################
Array
(
    [if] => ( $(wpcf-taxonomy-introduction2) ne '' )
    [debug] => true
)

####################
Debug information
####################
--------------------
Original expression: ( $(wpcf-taxonomy-introduction2) ne '' )
--------------------
--------------------
Converted expression: ( '' ne '' )
--------------------

and it's not work.

#595400

Okay thanks. In this instance, the best way to use the WYSIWYG field in a conditional that tests for an empty value is as follows:

[wpv-conditional if="( empty($(wpcf-taxonomy-introduction2)) )" evaluate="false"]
  [types termmeta='taxonomy-introduction2'][/types]
[/wpv-conditional]
#595472

sorry, it is not working.

#595629

Okay if you're still experiencing problems it's probably best for me to log in and take a look at your wp-admin area to see what's happening. I may need to install the Duplicator plugin to make a clone, then install that clone locally on my own environment for testing. If that's okay with you, please provide login credentials in the private reply fields here. If your site isn't online and available, please follow the instructions here to provide a copy of your site:
https://toolset.com/faq/provide-supporters-copy-site/

Please let me know which WordPress Archive is showing your terms, and where I can see the problem results on the front-end of your site.

The forum ‘Types Community Support’ is closed to new topics and replies.