Create a page where I load a URL in an iframe. The iframe value is stored in a types URL field.
My site uses Beaver Themer and Beaver Builder for assembly.
Link to a page where the issue can be seen:
Link 1: hidden link
Link 2: hidden link
Those links are displaying a custom layout, and display the fields from my custom post type 'Floorplan Details' such as the name, # bedrooms, bathrooms, etc.
I created a demo on my layout when I had this issue. There are 4 displays at the bottom of those two pages.
The first one is a manually set iframe code that includes the underlying URL of the 'Breck' Matterport tour that I'm trying to load. This confirms the destination is valid, but because its hard coded, it doesn't reflect the data for the individual post.
The second link does display the dynamic data, but only as a link to the matterport tour, not within the iframe. It adjusts between the two links above.
The last two links show my efforts to display the data
Here is the code I'm using:
<h6>Example 1: Manually setting fields - just plain vanilla iframe and my URL pasted in the src field</h6>
<iframe width="100%" height="500px" src="hidden link"></iframe>
<hr>
<h6>Example 2: Raw Link Data - validate the types code can display my URL data, without the iframe code</h6>
<p>[types field='matterport-tour-url'][/types]</p>
<hr>
<h6>Example 3: Original loading attempt - how I set things up when I first tried this, including output="raw" or raw="true" as found in the forums </h6>
<iframe width="100%" height="500px" src="[types field='matterport-tour-url' output=”raw”][/types]"></iframe>
<hr>
<h6>Example 4: Copy / Paste from Toolset forum solution attempt with my types field slug pasted in</h6>
<iframe src='[types field="matterport-tour-url" output="raw"][/types]' width="980" height="1000"></iframe>
So the issue is that using the shortcode in the iframe works but in your case it seems that you are using a plain text field. Meaning this field isn't process by php so shortcodes won't work in a field like this.
If possible try to use a WYSIWYG editor and it should work.
No, I don't think that's correct. If it wasn't parsing because of the HTML vs Text field container, the URL version (example 2, where I have the same code without the iframe code around it) wouldn't be working.
I also tried converting from an HTML field to a Text editor one, and it had the same set of results.
Try using the iframe without the page builder. I'm wondering if the pagebuilder is doing something when it comes to iframes, because i did some test on my localhost with an iframe and the shortcodes in it and it worked fine.
Thank you Shane. I've opened a ticket with the beaver builder folks and will advise back. The whole Beaver Themer environment is such that it is intrinsically tied to the Beaver Builder plugin - so we can't make a post type layout without using the plugin. If the plugin itself has an issue with iFrames, we'll have to sort it out another way (such as with Views, which we may need to do anyway if some of the floorplans don't yet have tours. )
I suspect that you are able to use this in Views because views actually allow for shortcode to be used as parameters for html, as there was some special function added so that this would work.
Wordpress officially removed support for shortcode as a parameter but we added it back as a special function in views.