Hi Wang,<br><br>What kind of content are you trying to customize? If it's a node, you can do something like node-my_node_type.tpl.php. This would change the theme around the various node types, but use a common page.tpl.php file to supply the header, menu, footer, etc.<br>
<br>You can override all of the *.tpl.php files like block, page, comment, etc in slightly different ways. Which is generally, I think, how you would do something like this dependent on the kind of content you want to theme. As a specific example, you can just create page-news.tpl.php for a unique ?q=news theme. (There's a gotcha though, so just make sure it's the original path, you will need to adjust if you use path aliasing like path_auto.)<br>
<br>Cheers,<br>Tim<br><br><div class="gmail_quote">On Wed, Jan 6, 2010 at 6:50 AM, Wang Zi Feng <span dir="ltr"><<a href="mailto:frank.zifeng@gmail.com">frank.zifeng@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hi,<br><br>There is a rookie question.<br><br>I use template_preprocess_page function in a module to specify a template file (news.tpl.php) based on the hook_menu path (?q=news), utilizing the news.tpl.php every time click on ?q=news, it works fine. <br>
<br>But I have to copy the footer&header from page.tpl.php to the new template file (news.tpl.php) to print them, I wonder if there is an approach to inherit automatically the footer and header section?<br><br>here is the code<br>
<br>function news_menu(){<br> $items['news'] = array(<br> 'title' => 'News',<br> 'page callback' => 'news_page_default',<br> 'access callback'=>TRUE,<br>
'type' => MENU_CALLBACK,<br> );<br><br> return $items;<br>}<br><br>function template_preprocess_page(&$variables){<br><br> if(drupal_strtolower(arg(0))=='news'){<br> $variables['template_file']='news' ;<br>
}<br> <br>}<br><br>Thanks <br><font color="#888888"><br>Wang<br><br>
</font></blockquote></div><br><br clear="all"><br>-- <br>Tim Loudon<br>(781) 686-6096<br>