This site requires an iframe, but at present the source is http only and WordPress doesn't display the content. The iframe URL is being added to the Page via an ACF field.
I am anticipating that at some point in the future, perhaps soon due to the upcoming Chrome 68 update, that the source site will be served as https.
What I'm trying to do is conditionally display either a link to the external site if the URL in the ACF field starts with http, but display the iframe if the ACF field starts with https. This way, when the URL becomes https at some point in the future the iframe can be displayed immediately without the client having to have me make changes in the layout.
Based upon other support tickets I have seen, I'm thinking it looks something like this, but this isn't working...
[wpv-conditional if="( wpv_contains('https','$(hannah_url)') ne '0' )"][iframe src="[wpv-post-field name='hannah_url']" width="100%" height="500"][/wpv-conditional]
I am using the IFRAME plugin (https://wordpress.org/plugins/iframe/) to enable the iframe shortcode. It works outside of the conditional statement as long as the URL is https.
Thanks for the reply. Unfortunately that does not seem to work.
I added the function wpv_contains, which I didn't have in place originally. It's also added in Toolset -> Settings -> Front-end Content -> Functions inside conditional evaluations. However, the conditional statement displays the iframe in all cases (whether or not the hannah_url field is http or https.)
I tried several variations of the conditional statement, using various syntax...
1. wpv-post-field in the conditional statement instead of types field.
2. reversing the order of the 'https' and the 'field'
3. Stating true instead of false
4. Using ne '0' instead of false or true
In each of these cases, either the iframe displayed (or didn't display if the syntax was otherwise incorrect) whether or not the field was http or https.
Looking at this it seems that we need to debug and see whats happening in the conditional shortcode.
Could you enable the debug for the shortcode by adding the debug = 'true' attribute. View the page on the frontend and provide a screenshot of the debug information so that I can have a look.