So, in other words, I’d maintain one set of templates for a site, but but within each template, I would have a portion dedicated solely to mobile browsers and a portion dedicated solely to standard "desktop" browsers, e.g.
<!-- this is my template -->
<mobile>
<html><head><title>[*pagetitle*]</title></head><body><!-- super simple streamlined formatting -->
</moble>
<standard>
<html><head><title>[*pagetitle*]</title></head><body><!-- standard, graphic intensive formatting -->
</standard>
And then on the
OnWebPagePrerender event, I’d find and replace one or the other parts of the template? The cache file would then contain all the full template file, including both the <mobile> and <standard> parts (and the page content). Caching would function normally on any page, yes? This is a fascinating approach... I just worry about the overhead of regexing each page request, but I imagine it’s much speedier to regex a cache file than it is to re-render everything from scratch.
Using the
OnWebPagePrerender poses some changes too... currently, I’m using the
OnLoadWebDocument to override the standard template with a mobile template based on either a URL parameter, a cookie value, or a browser detection script. By shifting to the <mobile> vs. <standard> dual-purpose templates, I could still rely on the URL parameters/cookie values/browser-detection scripts, but the result would determine which portion of the template to erase. Am I understanding this correctly?
The only drawback I can see here is UI for the designers: templates would become 2 in 1 hybrids, possibly making them more confusing to work with.
Many thanks for your clever input on this!