We are trying to display a View based on a conditional statement.
So, on this page:
hidden link
at the very bottom you see the Eating Out Section, and currently displayed is Edinburgh and Dundee restaurants based on two views with a taxonomy query filter set based on the restaurants location. So one view is set for Dundee and the other for Edinburgh. This all works fine.
However, what we want to do is display just ONE view with a conditional statement, based on where the client is staying when they book a golf tour.
This is the conditional statement we thought we could use, and simply wrap the entire view code block in the statement, which is how we are controlling the display of other custom data fields.
[wpv-conditional if="( $(wpcf-restaurant-location-01) eq 'RL_02' )"] entire view code block goes here [/wpv-conditional]
The location is set with a select menu option in the booking CLT Custom Fields - it will be different for each client.
So, when entering a clients golf tour booking, the location they will be staying is picked from the select menu and only the hotels for that location are displayed.
The first question, is each time we enter the conditional statement code and 'save' the content template, the statement we have added in code view is wrapped in <p>...</p> tags and therefore breaks. How do we stop this from happening?
The second questions is will this actually work? Are we able to hide/display views with a conditional statement?
Ultimately we plan to have 6 views in total.
Many thanks for your help.
Kind regards
Ade
My issue is resolved now. Thank you!