Page 1 of 1

help me understand preview-iframe.tpl

Posted: Sun Mar 26, 2006 10:35 pm
by carl_galloway
Hi all,

I've found that some of my themes don't play nice with the preview mode in admin suite and I want to fix this but I don't understand the javascript.

The most common problem I have is that the preview is squashed to just 5 or 6 pixels. The dusk theme is the one that annoys me the most at the moment so if anyone knows about these things would you be able to help me understand what the javascript does and how Serendipity uses the preview-iframe.tpl file?

Cheers

Carl

Re: help me understand preview-iframe.tpl

Posted: Sun Mar 26, 2006 10:42 pm
by garvinhicking
Hi!

The iframe's height should be set to the height of the full entry, so that an iframe preview does not have scrollbars. That's what the javascript is for.

It fetches the actual height of the "mainpane" HTML ID by default and then sets the height of the iframe to the height of #mainpane. If your template does not have a #mainpane element, it will set the width to some few pixels.

So the solution is:

a.) Provide a #mainpane wrapping element around your full entry preview.

b.) Change the javascript to get the width of another element of the entries.tpl.

The most common cause also is that elements within the #mainpane are floating, and whose heights are thus outside of #mainpane - which is why you might need a clear: both on an element within #mainpane.

HTH,
gArvin

(I'm having a flu and am a bit dizzy, so I hope to make at least some sense...)

Posted: Sun Mar 26, 2006 10:49 pm
by carl_galloway
Thanks Garvin, that kinda helps. I'll play around with it and see what I come up with. Get well soon my friend, Carl