Comment 6 for bug 100947

Revision history for this message
Kit Blake (kitblake) wrote :

Jasper and I had some extensive train time yesterday on the way to a client, and we've come to a conclusion (feel free to quibble :)). The iframe solution looks good but has a couple of dirty tricks. One of them is loading a style tag within the body of a page, actually within the Silva content. The other is shifting the body down 50 pixels to make room for the iframe is dubious.

Jasper's suggestion was to use a frameset, and after discussing the consequences we think it's the cleanest way to go. This would mean that tab_previww.pt would contain frameset code with a condition that checks if the meta_type is a container or versioned content. If not, the preview remains the same, e.g. preview for an image doesn't need a frameset. If the frameset does come into play, it means the two documents cannot possibly conflict with each other.

The frameset would have two rows:
<frameset rows="50px,*">

and have two frame sources:
1. A page template that renders the breadcrumbs, tabs, and middleground (adjusted with target="_parent" links), exactly as tab_preview looks today.
2. The preview_html.

We can throw away all the hacky code that inserts the publisher buttons in preview_html in VersionedContent.py. This also makes it easier to preview containers. We'll still have to introspect and see if the container's index can be published and show or not show the publish button in the middleground.

Jasper thinks a frameset sounds yucky but it's needed, and thisfred said he thinks its a justified use case. Andy, any thoughts? Does this make sense?