<HTML>
<HEAD>
<TITLE>Re: [support] Overriding page.tpl.php for node type...</TITLE>
</HEAD>
<BODY>
<FONT SIZE="4"><FONT FACE="Calibri, Verdana, Helvetica, Arial"><SPAN STYLE='font-size:11pt'>Again, I appreciate all the help.<BR>
<BR>
It appears I&#8217;ve been mistaken. &nbsp;It&#8217;s not that my page-[contenttype].tpl.php isn&#8217;t being recognized, it&#8217;s that components on it are not being rendered.<BR>
<BR>
I put some text into the template and I see it show up when I go to <a href="http://localhost/contenttype">http://localhost/contenttype</a> &nbsp;so the page is recognized. &nbsp;But the node is not rendered, nor are other elements that are rendered when I go to <a href="http://localhost/node.">http://localhost/node.</a><BR>
<BR>
I&#8217;ll probably just have to attempt to debug this further. &nbsp;I just find it weird that these things aren&#8217;t coming up. &nbsp;I might have to do more work with the pre-process methods.<BR>
<BR>
<BR>
On 4/10/09 11:46 AM, &quot;John Callahan&quot; &lt;john.callahan@UDel.Edu&gt; wrote:<BR>
<BR>
</SPAN></FONT></FONT><BLOCKQUOTE><FONT SIZE="4"><FONT FACE="Calibri, Verdana, Helvetica, Arial"><SPAN STYLE='font-size:11pt'>Could the problem also be that the base template file needs to also<BR>
exist? &nbsp;&nbsp;For example, in order for node-[content type].tpl.php to work,<BR>
node.tpl.php must also exist and be in the same directory. &nbsp;&nbsp;&nbsp;Maybe the<BR>
same goes for page templates?<BR>
<BR>
- John<BR>
<BR>
<BR>
<BR>
<BR>
Aldo Martinez Selleras wrote:<BR>
&gt; look, that was my guide<BR>
&gt;<BR>
&gt; Different page templates for different content types<BR>
&gt; Description<BR>
&gt;<BR>
&gt; Once upon a time there was a drupal themer working on a dark and stormy night,<BR>
&gt; he sat there wondering how to make different page templates for certain<BR>
&gt; content types on his site. He thought about how the drupal template system<BR>
&gt; seems to be missing this for some reason... Suddenly, he had a vision! Like a<BR>
&gt; ray of light bringing, hope and happiness down from the heavens!! oh yes!!<BR>
&gt; Resolution<BR>
&gt;<BR>
&gt; &lt;?php<BR>
&gt; // Add additional template suggestions<BR>
&gt; function _phptemplate_variables($hook, $vars) {<BR>
&gt; &nbsp;&nbsp;switch ($hook) {<BR>
&gt; &nbsp;&nbsp;&nbsp;&nbsp;case 'page': <BR>
&gt; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;// Add page template suggestions based on node type, if we aren't<BR>
&gt; editing the node.<BR>
&gt; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if ($vars['node'] &amp;&amp; arg(2) != 'edit') {<BR>
&gt; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$vars['template_files'][] = 'page-'. $vars['node']-&gt;type;<BR>
&gt; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<BR>
&gt; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;break;<BR>
&gt; &nbsp;&nbsp;}<BR>
&gt; &nbsp;&nbsp;return $vars;<BR>
&gt; }<BR>
&gt; ?&gt;<BR>
&gt;<BR>
&gt; This means if you have a content type called event and you want it to have a<BR>
&gt; custom page layout, just copy page.tpl.php to page-event.tpl.php.<BR>
&gt;<BR>
&gt; got it?<BR>
&gt;<BR>
&gt; just dump the code into template.php, then make a page template called<BR>
&gt; page-[CONTENT TYPE].tpl.php<BR>
&gt;<BR>
&gt; and drupal will use that instead<BR>
&gt; <BR>
&gt; Can this be achieved for node.tpl<BR>
&gt;<BR>
&gt; Hi,<BR>
&gt;<BR>
&gt; Can we have different node templates based on the node types. Is this possible<BR>
&gt; in Drupal?<BR>
&gt; Posted by Visitor (not verified) on Thu, 2008-08-21 02:07<BR>
&gt;<BR>
&gt;<BR>
&gt; As of Drupal 5, just copy your node.tpl.php file to whichever<BR>
&gt; node-CONTENT_TYPE.tpl.php and that template file will be used for theming<BR>
&gt; nodes of that type.<BR>
&gt;<BR>
&gt; For example, node-event.tpl.php.<BR>
&gt; Posted by Benjamin Melan&ccedil;on on Thu, 2008-08-21 05:41<BR>
&gt;<BR>
&gt;<BR>
&gt; &nbsp;<BR>
--<BR>
[ Drupal support list | <a href="http://lists.drupal.org/">http://lists.drupal.org/</a> ]<BR>
<BR>
</SPAN></FONT></FONT></BLOCKQUOTE>
</BODY>
</HTML>