|Embedding with S2
||[Sep. 6th, 2003|10:55 pm]
As I see it, we have three main options for embedding now:
- Have users create S2 layouts with
Page::print() essentially blank other than the call to
print_body, thus creating a style which can be embedded into a page, then load it as with any other style. This is roughly how it worked in S1, although for S2 this strikes me as a very hacky solution.
- Have some kind of special support for embedding in S2.
- Don't do anything, and let users go on using S1 for embedding via customview.cgi.
Out of all of these, the special support option is my favourite. However, it doesn't have to be anything particularly complex. A parameter to either the style or the request query string could simply trigger “embedded mode” where the entry point changes from
Page::print_body(), leaving the script which retrieves the output to replace what would before have come from
This also means that any system layout can potentially also be used as an embedding style with no code changes necessary. As far as I'm aware, all of the system layouts are designed properly so that the view-specific body doesn't depend on anything in the general “template” code. A side-benefit from this is that hopefully most people will be happy just embedding a system layout perhaps with some overrides, which are more efficient since they do trusted prints and thus are easier on the server.
I'm not sure whether this should be a style option or a URL option. The latter means that a user does not have to create an additional style in order to embed; he or she can simply use their standard style with the “embedded mode” parameter.
Any other thoughts?