understanding 2k11 preview_iframe.tpl

Discussion corner for Developers of Serendipity.
User avatar
Posts: 7111
Joined: Fri Jan 13, 2006 11:46 am
Location: Eutin, Germany

Re: understanding 2k11 preview_iframe.tpl

Post by yellowled » Sun Feb 22, 2015 9:07 pm

yellowled wrote:This whole stupid #serendipity_preview_spacer has always been a mystery to me, albeit one I never investigated further. I don't know where it is coming from, I don't know what use it has (if any), I just know that it for some reason has to be there and has to be hidden using inline styles.
So, what better to do on a Sunday night than to investigate some legacy code, right?

First of all, we discussed this a few years ago already (2008, to be exact). TL;DR: we still don't know why it is there.

The interesting part of that thread is that it tells us where this little bugger is generated: include/functions_config.inc.php. I should say: "used to be generated", because it is no longer. The part of functions_config.inc.php that Don quoted in the old thread now looks like this:

Code: Select all

case 'preview':
    $serendipity['smarty_preview']  = true;
    $data['preview'] = serendipity_printEntries(array($entry), ($entry['extended'] != '' ? 1 : 0), true);
which means that this ominous spacer div no longer exists in the code. I have no idea when and why it was removed (and I'm too lazy to look up the commit history of said file), but it is no longer in 2.0, and I assume we don't need it anymore (probably didn't need it for a long time, as is usually the case with legacy code).

So it should be safe for any theme that either is part of the 2.0 core or requires at least 2.0 to remove anything related to #serendipity_preview_spacer. \o/

amazon Wishlist - Serendipity-Podcast (German only, sorry)

User avatar
Don Chambers
Posts: 3645
Joined: Mon Feb 13, 2006 2:40 am
Location: Chicago, IL, USA

Re: understanding 2k11 preview_iframe.tpl

Post by Don Chambers » Sun Feb 22, 2015 9:37 pm

Yeah - I eliminated it from the theme I am working on a few weeks ago. problem I have with this theme is that I am not getting the proper height in the iframe. You will see it hopefully this week.

Post Reply