Closed (fixed)
Project:
Acquia Marina
Version:
6.x-1.2
Component:
User interface
Priority:
Normal
Category:
Bug report
Assigned:
Reporter:
Created:
21 Oct 2008 at 06:08 UTC
Updated:
20 Nov 2008 at 08:02 UTC
Jump to comment: Most recent file
Comments
Comment #1
jwolf commentedThis is a bug in the template.php file that comes with this theme.
I have tentatively fixed this by changing line 327 of template.php from:
to:
Patch is attached and needs review before I commit this fix.
Please be aware that with the above fix you will only be able to target the node teasers and not the node page (full node) with node-article.tpl.php
We made it so that you can create separate template files for node teasers and node pages. So, by creating node-article-page.tpl.php you will be able to target the node's page.
node-article.tpl.php = article teasers
node-article-page.tpl.php = article page (full node)
Comment #2
MedicSean37 commentedThanks, for your help. I'll patch it up this evening and report back.
Comment #3
MedicSean37 commentedThis fixed my problem. Thank you!
Comment #4
gpk commentedMaybe I'm completely off track but it looks to me like the replaced code is not quite right ... the elseif condition is the same as the first if condition ... should not the replacement code be:
so that you get the same templates as for full page view, but without the -page part in the filename. Strictly speaking, $node->type should also have any _ converted to - (see related issue #269443: Add nid to node template suggestion and clean node type suggestion.).
I think the reason it worked was that the elseif block never got executed, so you ended up with the one and only default template suggestion, namely node type, which is what the op wanted in this case.
Comment #5
jwolf commented@gpk - Right you are. Thanks for the correction.
I think we're gonna have to hold off on this "feature" for now.
The template suggestion behavior is not working correctly even w/ gpk's fix. The way it *should* work is that if node-type-page.tpl.php is absent, the node page *should* fall back on the node-type.tpl.php. Right now, node-type.tpl.php isn't a candidate for node page w/ this code enabled in the theme.
I'm removing the code for now so that the default node template suggestion behavior is working correctly; so that the theme is providing the expected behavior and not causing problems while we figure this one out.
@MedicSean37 - thanks for reporting this.
The changes have been committed and are available w/ the most recent devel snapshot. Will be in he 6.x-1.3 release soon.
Comment #6
Anonymous (not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.
Comment #7
jwolf commentedHere is the correction for the template suggestion part of template.php which will fix this issue.
I tweaked the template suggestions a bit and created what I believe is the correct template suggestion order for both teaser view and page view.
With the above tweaks the template candidates are as follows:
PAGE VIEW:
node-[nid]-page.tpl.php
node-[type]-page.tpl.php
node-[nid].tpl.php
node-[type].tpl.php
node.tpl.php
TEASER VIEW:
node-[nid].tpl.php
node-[type].tpl.php
node.tpl.php
I tested the changes and all is good - will commit changes and should be available in the most recent dev snapshot.