Passer la navigation

[Résolu] Views with conditional output

This support ticket is created Il y a 2 years, 6 months. 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.

Ce sujet contient 1 reply, a 2 voix.

Dernière mise à jour par Christopher Amirian Il y a 2 years, 6 months.

Assisté par: Christopher Amirian.

Auteur
Publications
#2664211
ss 1.PNG
s2.PNG
s3.PNG
s4.PNG

Hello,

I need help with some conditional outputs I'm using. I have an Industries page: lien caché

And I created a view per industry because there are some products that I need to show if the industry is selected.

For example, here: lien caché I checked "Automatizacion" for each product, and they show correctly on the page.

But if I check the product with 'Automatizacion' and 'Computadoras,' I can't see the product on the "Computadoras" page: lien caché

In this case, the product CC600 has been checked with "Automatizacion" and "Computadoras."

This is my code:
<wpv-loop>
[wpv-conditional if="( $(wpcf-type-of-industry) eq 'Computadoras' )"]
<div class="nl_unit">
<img src="[types field='unit-img' output='raw'][/types]">
<h4>[wpv-post-title]</h4>
lien caché
</div>
[/wpv-conditional]
</wpv-loop>

I want to know if there's a way to do a multiple selection of industries in each product and show all of them on their respective Industry page.

I'll leave some screenshots, and please let me know if my issue is understandable. Thank you!

#2664439

Christopher Amirian
Supporter

Les langues: Anglais (English )

Hi there,

First, you need to know why the second code does not work but the first code works.

Try to use the code you already know it works in the screenshot and just replace the value and see if it works for the second one.

Also try with a product that only has "Computadoras" selected and see if it works.

Usually, the best way to create the view content is to use the filter queries:

https://toolset.com/course-lesson/filtering-custom-lists-of-posts/

But if you want to use conditionals, you can consider using OR / AND operators to combine the conditions.

For more information:

https://toolset.com/forums/topic/conditional-view-with-or/

Thanks.