Skip Navigation

[Resolved] Conditional isn't working for wpv-post-taxonomy…

This support ticket is created 4 years, 9 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
9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 - - 9:00 – 13:00
14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 - - 14:00 – 18:00

Supporter timezone: Africa/Casablanca (GMT+01:00)

This topic contains 18 replies, has 2 voices.

Last updated by Jamal 4 years, 9 months ago.

Assisted by: Jamal.

Author
Posts
#1568531
without-conditional.JPG
with-conditional.JPG

Tell us what you are trying to do?
I have a taxonomy with a description that is showing up perfectly as expected using:
[wpv-post-taxonomy type="series-line" format="description"]

However, when I add this conditional line:
[wpv-conditional if="('[wpv-post-taxonomy type='series-line' format='description' ]' ne '' )"]
to control the formatting, it doesn't work.

Here's the entire block, it doesn't work in parts or together.

[wpv-conditional if="('[wpv-post-taxonomy type='series-line' format='description' ]' ne '' ) OR ( $(wpcf-subseries-video-embed) ne '' )"]
<div class="uk-flex uk-flex-center uk-flex-middle uk-text-center uk-margin-bottom" uk-height-match="target: .uk-tile" uk-grid>
[/wpv-conditional]

[wpv-conditional if="('[wpv-post-taxonomy type='series-line' format='description' ]' ne '' )"]
<div class="uk-width-1-2@l uk-tile">
[wpv-post-taxonomy type="series-line" format="description"]
</div>
[/wpv-conditional]

[wpv-conditional if="( $(wpcf-subseries-video-embed) ne '' )"]
<div class="uk-width-1-2@l uk-tile">
[types field='subseries-video-embed'][/types]
</div>
[/wpv-conditional]

[wpv-conditional if="( '[wpv-post-taxonomy type='series-line' format='description']' ne '' ) OR ( $(wpcf-subseries-video-embed) ne '' )"]
</div>
[/wpv-conditional]

Is there any documentation that you are following?
[wpv-conditional if="('[wpv-post-taxonomy type='foreign-language' format='slug' ]' ne '' )"]
Foreign languages: [wpv-post-taxonomy type="foreign-language"]
[/wpv-conditional]

https://toolset.com/documentation/user-guides/views/conditional-html-output-in-views/displaying-taxonomies-conditionally/

Is there a similar example that we can see?
N/A

What is the link to your site?
Restricted

#1569443

Hello and thank you for contacting the Toolset support.

I made a simple test locally and I was able to make it work with the following code for my example:

    [wpv-conditional if="( '[wpv-post-taxonomy type='category' format='slug']' ne '' )"]
      [wpv-post-taxonomy type='category' format='slug']
    [/wpv-conditional]

I might need access to your website to check it further. If your website is online, please enter credentials in your next reply, which will be private. ** Take a database backup before sharing credentials **

#1569669

The main difference is that mine is a description rather than a slug... I would think it would work the same though...

[wpv-conditional if="('[wpv-post-taxonomy type='series-line' format='description' ]' ne '' )"]
<div class="uk-width-1-2@l uk-tile">
[wpv-post-taxonomy type="series-line" format="description"]
</div>
[/wpv-conditional]

#1569693

Sorry for sharing the slug example, I tested with both description and slug, here is my code for description:

    [wpv-conditional if="( '[wpv-post-taxonomy type='category' format='description']' ne '' )"]
      [wpv-post-taxonomy type='category' format='description']
    [/wpv-conditional]

It is basically the same and it is working for me. Can you allow me access to your site to check it further? Or share a Duplicator copy on GDrive/Dropbox/or similar and let me take a look at it locally?

#1569737

Thank you for the access information, but it seems that I'll need more privileges to check the content templates, I do not have the Toolset menu with the provided user. I can access the Subwoofer Series and Series Lines though.
Please double-check with the provided user to be sure.

#1569797

This issue should now be resolved.

#1570487

Thank you for your access. I tried several conditional tests and it seems that it is not working only with the taxonomy/term description.
I tested again locally, with a default and a custom taxonomy and the same description as your term but it worked without issues, the description size is not the cause, check it here hidden link

We'll need to take a Duplicator copy of your website to debug further why it is not working on your site. Please let me know if I can install Duplicator and take a copy of your website?
If you would create the copy, please exclude the uploads folder to reduce the size of the copy.
https://toolset.com/faq/provide-supporters-copy-site/

#1571007

Thanks Jamal. We're fine with this, but I'm a little confused on who does what...

Are you going to install Duplicator and take the copy?
OR
Am I installing Duplicator and sending it to you?

Either is fine by me. If you're doing the install and taking the copy, please proceed, otherwise just let me know.

#1571041

Hello Shawn, I installed Duplicator but I could not take a Duplicator package. Wordfence was blocking me. Even after deactivating it and trying from two different browsers, there seems to be some server configuration that blocks me from taking the copy and shows a Wordfence page that has the following message:

403 Forbidden <br>
A potentially unsafe operation has been detected in your request to this site.

Can you try from your side? Please use the following configuration to reduce the size of the package hidden link
Your next reply will be private to share a download link safely.

#1571093

That certainly created a stir on our end. We started receiving blank emails via Toolset form. The template content showed up, but the required fields were left blank. We received about 48 such emails from 10:56am us-cst to 11:35am us-cst (it's a little after noon here right now).

For the moment, we'll put the site duplicating on hold...

Can you tell us more of a step by step of what you did so we can determine if this is a bug or a exploit and if it's to do with Wordfence or Duplicator? Any other help you can offer would be appreciated.

#1571095

Also, I have deactived Duplicator until we can make sense of this issue.

#1572077

I first installed Duplicator and tried to create a package, after the first step, I was redirected to the 403 error page from Wordfence.
Then I deactivated Wordfence to retry, I got the same page. I thought it is probably a browser cached redirect, so, I tried to create a Duplicator package from a new session in an incognito window, I got the same error page. Then I reactivated Wordfence.

If Duplicator is not working to get a copy, we can check with a vanilla copy from your website(database export+themes folder+plugins folder).

#1572491

If you are able to use Updraft you can just download the most recent backup from the site. But if that isn't an option for the same reason as you found with Duplicator, I can email you a download link. Please give me a private email address, or email the address we have on file and we'll reply to that.

#1573399

I took yesterday an updraft backup and built it locally. I had to deactivate "really-simple-ssl", "redirection" and "wordfence" to be able to work. The shortcode was working. Then I checked on your website and I can see that the shortcode is working.

I don't know what changed on your server from yesterday, maybe a cache was purged!

Please let me know if you still need assistance with this issue.

#1573475
still-not-showing.JPG

Unfortunately, I'm not having the same experience. The screenshot attached shows the code with the output next to it in an incognito window. You'll see that the code still says ne '' but it's still blocking the description which does not equal empty.

ACTUALLY... I bet I know what the problem is... You might be looking at the wrong page.

The content template in the screenshot that we're working on is to be a more dynamic and stable replacement for the current subwoofer series page, which is a static "page" with embedded taxonomy term views.

hidden link -- OLD -- Ignore this.
hidden link -- NEW

Sorry if that's the issue, I should have given you a heads up.