Skip Navigation

[Resolved] I cannot insert a URL value into an iframe src and parse it as raw output

This support ticket is created 7 years, 1 month ago. 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.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 -
- 13:00 – 18:00 13:00 – 18:00 13:00 – 18:00 14:00 – 18:00 13:00 – 18:00 -

Supporter timezone: America/Jamaica (GMT-05:00)

This topic contains 13 replies, has 2 voices.

Last updated by Shane 7 years, 1 month ago.

Assisted by: Shane.

Author
Posts
#579664

I am trying to:

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>

#579707

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi George,

I tried logging in to check on this for you but it seems their is a validation email with a code.

Unfortunately i'm not able to get this code because you may not have used the correct email.

Could you try creating the account with the email shane.c@onthegosystems.com

Thanks,
Shane

#579708

Hi Shane,

I've updated the login to use the email address you provided. Thank you!

George

#579924

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi George,

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.

Thanks,
Shane

#579935

Hi Shane,

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.

I'll add that in now again just to be sure.

George

#579937

Hi Shane,

I've added a text block to the page, and moved the code there, and the behavior is the same.

George

#579940

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi George,

I'm having some difficulties using the Page builder to test this.

Could you send me a link to the page where you placed the text editor.

Thanks,
Shane

#579945

Sure thing shane.

I've got a little video that walks through how to edit the themer / layout using the Page Builder.

hidden link

And here's how / where I edit the layouts from the front end when viewing, for example this page:

hidden link

Video:
hidden link

#579974

Testing out something for a moment

I was using the types native invocation such as:

[types field="matterport-tour-url" output="raw"][/types]

going to switch to the beaver builder variant:

[wpbb post:custom_field key='matterport-tour-url']

I'll report back my findings here shortly

George

#579980

No change from my test.

#580010

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi George,

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.

Thanks,
Shane

#580280

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'm going to leave this open for now.

#580344

Well, interestingly, installing WP-Views fixes the matterport / iFrame issue .... but it also kills my beaver builder instance.

I can now view the Floorplan Detail layouts with the Matterport URL loading into the frame, but cannot use beaver themer to edit my layouts.

#580375

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi George,

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.

Thanks,
Shane