I need to use a conditional, using a field, inside a view. I'm in content template, and this view is about a related custom post. Template is for "places", and view is for "venues" in this places. I try to use a condition on the venue's view. "If a field is 1", show this. As I don't have "else", I also use NOT "If a field is 1", to show another thing. But second condition is always true.
Hi,
there is a field called llum-solar that indicates if a venue has natural sunlight or not. If the field is '1', I need to show venue's name followed by a sun icon. If not, just the name. As I can't use a "else", I've created two conditions, one for field = 1, and one for not(field = 1), or now field=''. This second condition is the one is not working.
If you look a this url
hidden link
you can see there are some venues with sunlight, and other without. The ones with sunlight show the name twice, because second condition is always true.
I see you are using cache as well - Please try to delete the cache and check.
If your issue still persists - what if you try to use the conditional shortcode instead of conditional block. You can add the following conditional shortcodes by adding shortcode block to your content template
[wpv-conditional if="( '[types field='llum-natural' output='raw'][/types]' eq '1' )"]
your code goes here
[/wpv-conditional]
[wpv-conditional if="( '[types field='llum-natural' output='raw'][/types]' eq '' )"]
your code goes here
[/wpv-conditional]
This is Christopher following up on the issue. Would you please check that the field itself is not translated? If so then the conditional will not work.
And usually the page that the view is used should be refreshed:
- Go to your Dashboard > Pages.
- Open the edit screen of the original page. You should see a pencil/circle/gear icon in the sidebar options under the "Languages" section.
- Make a small change, for example, add an extra blank space at the end of a sentence/paragraph.
- Save it.
- You should now see that a circular arrow appears beside the 2nd languages links, this means that an update is required.
- Edit the translation again and save it up to 100% translated.
Also I could not find the aection in the page that you use dthe conditional can you give some screenshots?