<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'>So you’re saying there’s no way, out of the box, to have a page template associate with a specific node type?<BR>
<BR>
There’s no function that I could write to automatically associate a page template with a specific node type?<BR>
<BR>
Is the only real way to achieve this with a view?<BR>
<BR>
If this is true, that’s helpful and I’ll just go down that path. I’m just sure I know of people (who are on vacation now) that have made this work.<BR>
<BR>
</SPAN></FONT><FONT COLOR="#0000FF"><FONT FACE="Arial"><SPAN STYLE='font-size:10pt'><U><a href="http://drupal.org/node/234279">http://drupal.org/node/234279</a><BR>
</U></SPAN></FONT></FONT><FONT FACE="Arial"><SPAN STYLE='font-size:10pt'> <BR>
</SPAN></FONT><FONT FACE="Calibri, Verdana, Helvetica, Arial"><SPAN STYLE='font-size:11pt'><BR>
<BR>
On 4/10/09 9:33 AM, "Blake Hall" <hall.blake@gmail.com> wrote:<BR>
<BR>
</SPAN></FONT></FONT><BLOCKQUOTE><FONT SIZE="4"><FONT FACE="Calibri, Verdana, Helvetica, Arial"><SPAN STYLE='font-size:11pt'>Basically, you should be calling the template file page-node-[url].tpl.php<BR>
<BR>
Take a look at <a href="http://drupal.org/node/190815">http://drupal.org/node/190815</a><BR>
<BR>
The override priority for pages looks like this:<BR>
</SPAN></FONT></FONT><OL><LI><FONT SIZE="4"><FONT FACE="Calibri, Verdana, Helvetica, Arial"><SPAN STYLE='font-size:11pt'>page-node-edit.tpl.php
</SPAN></FONT></FONT><LI><FONT SIZE="4"><FONT FACE="Calibri, Verdana, Helvetica, Arial"><SPAN STYLE='font-size:11pt'>page-node-1.tpl.php
</SPAN></FONT></FONT><LI><FONT SIZE="4"><FONT FACE="Calibri, Verdana, Helvetica, Arial"><SPAN STYLE='font-size:11pt'>page-node.tpl.php
</SPAN></FONT></FONT><LI><FONT SIZE="4"><FONT FACE="Calibri, Verdana, Helvetica, Arial"><SPAN STYLE='font-size:11pt'>page.tpl.php<BR>
</SPAN></FONT></FONT></OL><FONT SIZE="4"><FONT FACE="Calibri, Verdana, Helvetica, Arial"><SPAN STYLE='font-size:11pt'>Cheers,<BR>
<BR>
blake hall<BR>
<BR>
<BR>
On Fri, Apr 10, 2009 at 8:24 AM, Scott Matthews <smatthews@optaros.com> wrote:<BR>
</SPAN></FONT></FONT><BLOCKQUOTE><FONT SIZE="4"><FONT FACE="Calibri, Verdana, Helvetica, Arial"><SPAN STYLE='font-size:11pt'>I’m not sure I understand your question? I’m not using path auto or views. I’m just typing in the URL:<BR>
<BR>
<a href="http://localhost/type">http://localhost/type</a><BR>
<BR>
And looking to access the page<BR>
<BR>
Page-type.tpl.php<BR>
<BR>
<BR>
<BR>
On 4/10/09 9:13 AM, "Steve Kessler" <skessler@denverdataman.com> wrote:<BR>
<BR>
</SPAN></FONT></FONT><BLOCKQUOTE><FONT SIZE="4"><FONT FACE="Calibri, Verdana, Helvetica, Arial"><SPAN STYLE='font-size:11pt'>The page you are trying to create what is creating the URL. Does the URL come from Pathautor or Views?<BR>
<BR>
Thanks,<BR>
Steve<BR>
<BR>
<BR>
Steve Kessler <BR>
<B>Denver DataMan <BR>
</B>303-587-4428 <BR>
<FONT COLOR="#0000FF">Sign up for the Denver DataMan Free eNewsletter</FONT> <a href="http://www.denverdataman.com/content/enewsletter-signup"><http://www.denverdataman.com/content/enewsletter-signup></a> <BR>
<BR>
<BR>
</SPAN><SPAN STYLE='font-size:10pt'><B>From:</B> Scott Matthews [<a href="mailto:smatthews@optaros.com]">mailto:smatthews@optaros.com]</a> <a href="mailto:smatthews@optaros.com%5D"><mailto:smatthews@optaros.com%5D></a> <BR>
<B>Sent:</B> Friday, April 10, 2009 6:53 AM<BR>
<B>To:</B> support@drupal.org<BR>
<B>Subject:</B> [support] Overriding page.tpl.php for node type...<BR>
</SPAN></FONT></FONT><FONT SIZE="5"><FONT FACE="Times New Roman"><SPAN STYLE='font-size:12pt'> <BR>
</SPAN></FONT></FONT><FONT SIZE="4"><FONT FACE="Calibri, Verdana, Helvetica, Arial"><SPAN STYLE='font-size:11pt'>This should be a simple question and answer...<BR>
<BR>
I know that a basic premise of Drupals theme hierarchy should be that if I want a page for a specific node I make a file page-[<I>type</I>].tpl.php. I have done this and I still get a “Page not found” issue. Creating a node-[type].tpl.php works for overriding the node template for the specific node type.<BR>
<BR>
Does anyone have any suggestions for what might be missing from the out of the box Drupal solution to get this working?<BR>
<BR>
I’ve tried adding the following function to my template.php which I found on a forum post previously but with no success:<BR>
<BR>
function _phptemplate_variables($hook, $vars) {<BR>
if ($hook == 'page' && isset($vars['node'])) {<BR>
$vars['template_files'][] = 'page-'.str_replace('_', '-', $vars['node']->type);<BR>
}<BR>
return $vars;<BR>
}</SPAN></FONT></FONT><FONT SIZE="5"><FONT FACE="Times New Roman"><SPAN STYLE='font-size:12pt'> <BR>
</SPAN></FONT></FONT><FONT SIZE="4"><FONT FACE="Calibri, Verdana, Helvetica, Arial"><SPAN STYLE='font-size:11pt'><BR>
<BR>
--<BR>
[ Drupal support list | <a href="http://lists.drupal.org/">http://lists.drupal.org/</a> ]<BR>
<BR>
<BR>
</SPAN></FONT></FONT></BLOCKQUOTE></BLOCKQUOTE></BLOCKQUOTE>
</BODY>
</HTML>