The iframe size in the editor is different from the iframe size in the preview

  • 1
  • Problem
  • Updated 4 years ago
  • Solved
For a template w/ HTML, I wrote:

<iframe src="https://app.webpt.com/patientChart.php?ID={{WebPT_ID__c}}";  width="100%" height="1000"> </iframe>

The dimensions work in the builder but not in the preview. Any suggestions?


Photo of Griffin Brown

Griffin Brown

  • 2,766 Points 2k badge 2x thumb
  • fresh

Posted 4 years ago

  • 1
Photo of mB Pat Vachon

mB Pat Vachon, Champion

  • 42,674 Points 20k badge 2x thumb
Not sure why, but the dimensions stayed the same when I used you're template.



Photo of Rob Hatch

Rob Hatch, Official Rep

  • 44,006 Points 20k badge 2x thumb
If you inspect the elements in the rendered page you will probably see that the iframe is broken after the ID is merged.  This is because the ID is getting put in with all its rendering code (including a bunch of HTML).   You need to merge the data in that iFrame with {{{Triple Braces}}}.   That will merge the ID Data alone,  no rendering will be attempted. 

That shoudl fix your problem. 
Photo of Griffin Brown

Griffin Brown

  • 2,766 Points 2k badge 2x thumb
That was super fast!

One day I'll have you explain to me why that works, but for now I'll accept it dogmatically. :-)
Photo of Griffin Brown

Griffin Brown

  • 2,766 Points 2k badge 2x thumb
It worked by the way
Photo of Griffin Brown

Griffin Brown

  • 2,766 Points 2k badge 2x thumb
And Pat - you're lightning fast with your responses. Do you work for Skuid or are you just a do-gooder?
Photo of mB Pat Vachon

mB Pat Vachon, Champion

  • 42,674 Points 20k badge 2x thumb
hehehe ... just really really really diggin it right now. The answer to all my salesforce dreams! So I've kinda been neck deep since starting to use it this month. :Pat
Photo of Rob Hatch

Rob Hatch, Official Rep

  • 44,006 Points 20k badge 2x thumb
You guys are too much.  We love our raving fans!  We especially love the fact they are willing to help each other out!  Keep up the good work. 
Photo of Robin

Robin

  • 894 Points 500 badge 2x thumb
Hi fellow Skuids,

I'm struggling to implement even the most basic iframe in a template component. We're talking <iframe width="99%" height="600" src="http://www.google.com.au" /> here as a test. 
I can't get any content to display in the iframe, however "invalid" data for the "src=" parameter produces Salesforce's "URL no longer exists" error message.

Would this have to do with my Org's security settings, or where would I start troubleshooting it? The inspect element code of the rendered page is <div class="nx-template"><iframe width="99%" height="600" src="http://www.google.com.au"></iframe></div>.

I might be missing something very obvious here! "Allow HTML" and "do not run template on each row" are selected. The model I picked for the template is the "User" model, which is loaded on page load and has data in it, but I also tried other models with the same result.

Page include components which reference other Skuid pages render without issue.

Any help is greatly appreciated!

Thank you,

Robin
(Edited)
Photo of Griffin Brown

Griffin Brown

  • 2,766 Points 2k badge 2x thumb
Hey Robin,


It's most likely the case that Google blocks the use of iframes for it's site for security reasons. Many of the big sites will do that. Try a smaller, less common site and it will likely work.


-G
Photo of Robin

Robin

  • 894 Points 500 badge 2x thumb
Hi Griffin!

Thanks for helping out. I just tried different domains including our company site, still no joy unfortunately. Great thinking though, didn't consider that possibility.

Forgot to mention (and hope this is the problem!): I am running the Superbank release, are iFrames still disabled in the beta?

Much appreciated, 

Robin
Photo of Rob Hatch

Rob Hatch, Official Rep

  • 44,006 Points 20k badge 2x thumb
Robin,  iFrames are not disabled in the Superbank beta.  (at least I've been able to use them in Beta Orgs).  I'm guessing somthing else is afoot. 
Photo of Moshe Karmel

Moshe Karmel, Champion

  • 8,646 Points 5k badge 2x thumb
Robin, you're probably having an issue with the iframe because you're loading a HTTP URL into a HTTPS page. Try loading in a salesforce page from your org.
Photo of Griffin Brown

Griffin Brown

  • 2,766 Points 2k badge 2x thumb
Hey - Is it possible to get in on the Superbank release now?
Photo of Rob Hatch

Rob Hatch, Official Rep

  • 44,006 Points 20k badge 2x thumb
Patience.  We plan to have a Release Candidate out on Friday. 
Photo of Robin

Robin

  • 894 Points 500 badge 2x thumb
Moshe, it was as simple as using an https url! Thank you so much, I knew it was something really basic. Appreciate your contribution as well as everybody else's suggestions!!!

Robin
(Edited)