You could write the head from the body using the INCLUDE directive
I could, and I do on some simple sites...
However, my usual approach is to have a module that deals with all the Template processing. Besides new it usually has just three methods, head, process and foot.
head deals with preview images, page titles, external CSS/JS files, etc providing a standard setup that can be changed on a per-script basis.
foot does much the same as head but there are less variations - mostly copyright date.
process obviously processes the body script but also deals with user login state, log files, etc depending on the site's needs.
I was looking for a solution that I could just put in head that would give me the latest modification time of the body template as I don't want to start rewriting several websites just to get this information. As I don't think it's going to be possible, I'm looking at having another script that reads stat for the relevant body template file. There is still a problem with older scripts that generate the HTML within the script (the way I did it before the Wisdom of The Monastery reached me!) because the script modification time is the same for every page it generates.
But there is also the question of what is actually a modified date...if a script provides the data to a template, changing the script or changing the template could cause an update to the resultant webpage.
|