postprocess theme in Drupal 6?
I'd like to override theme_page() with the following logic: first use the page.tpl.php template, as the theme normally would; then, do some special processing to the output of the template. In drupal 5 this was easy enough, in drupal 6 I can't figure out how. If you can help, please respond to http://drupal.org/node/262085. (Sorry to bother the devel list with what might be considered a support question, but I'm stumped.)
Dave Cohen wrote:
I'd like to override theme_page() with the following logic: first use the page.tpl.php template, as the theme normally would; then, do some special processing to the output of the template. In drupal 5 this was easy enough, in drupal 6 I can't figure out how. If you can help, please respond to http://drupal.org/node/262085.
There's no postprocess in D6; in order to do what you want to do, you'd have to override theme_page as a function (i.e, implement phptemplate_page), call preprocessors yourself, then use drupal_render_template to render your page.tpl.php.
Thanks Earl for the quick reply. However, there is no phptemplate_page() in D6. There's theme(), which has a lot of complicated logic around hooks and templates which I'd rather not duplicate in my theme_page override. I want all preprocess and variable handling that normally applies to a page template. I still don't see a clean way to do it. -Dave On Friday 23 May 2008, Earl Miles wrote:
There's no postprocess in D6; in order to do what you want to do, you'd have to override theme_page as a function (i.e, implement phptemplate_page), call preprocessors yourself, then use drupal_render_template to render your page.tpl.php.
Dave Cohen wrote:
Thanks Earl for the quick reply. However, there is no phptemplate_page() in D6. There's theme(), which has a lot of complicated logic around hooks and templates which I'd rather not duplicate in my theme_page override. I want all preprocess and variable handling that normally applies to a page template. I still don't see a clean way to do it.
You can just call template_preprocess_page() from your THEMENAME_page() function.
participants (2)
-
Dave Cohen -
Earl Miles