Closed (won't fix)
Project:
Panels
Version:
7.x-3.x-dev
Component:
Miscellaneous
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
30 Jan 2008 at 15:47 UTC
Updated:
21 Nov 2011 at 07:59 UTC
is it possible to force a node to use a template based on its placement in the panel
using the panel identifier works really cool
in _phptemplate_variables...:
if (!empty($vars['node']->panel_identifier)) {
$vars['template_files'][] = 'node-panel-' . $vars['node']->panel_identifier;
}
but that assumes that the admin actually set that identifier
another could be we got a design that would use specific templates in each region nomatter what the admin says.
What im looking for is a way to force a specific template on each "content region"
so something like this:
I got $content[top_left], $content[top_right] defined in my layout/foo.inc
so how do i force all nodes thats placed inside $content[top_left] to use panel-node-top_left.tpl.php and $content[top_right] to use panel-node-top_right.tpl.php ?
Im a little lost
Comments
Comment #1
merlinofchaos commentedWell. Right now you can't do this, unless you create your own style, and that style sets a global variable or something that you read later.
At the moment, I don't think the actual information about the pane makes it into the rendering function, so there's no way to pass that to the node. And it'd be an API change to get this in, and I can't do that in beta; it'd break too much code.
I'd say that this is an oversight. It's not the only one; I've spotted several at this point, and much of it has to do with how the whole porject grew.
Comment #2
sunIs this still an issue? Did you update to the latest release?
Comment #3
michelleNo answer to #2. Closing.
Michelle
Comment #4
interestingaftermath commentedAny update on this? I moved from Composite Layout to Panels because I thought for SURE Panels would offer this (what I consider) basic functionality. Any way to do this yet?
Comment #5
michelle@interestingaftermath: 5.x is not supported anymore.
Michelle
Comment #6
merlinofchaos commentedComment #7
interestingaftermath commentedI'm sorry. I forgot to update the Version. This question is still relevant for 6.x. Is it possible?
Comment #8
merlinofchaos commentedUnfortunately, because the content types are being rendered in a way that is agnostic about where they are rendered, it's very difficult to actually give any kind of location data to the renderer. So this is still not possible, and it's looking more and more unlikely that it will ever be possible at least in this way.
What I'm thinking that *could* be possible is to create a sort of managed node template system, where outside of Panels itself you're able to tell Panels about the node templates that are available. Then inside the Panels system, when you add the 'node content' content type, you would get a select widget to select WHICH node template to use and it would automatically set that variable. That way it could remain unaware of which location its in, and be a little easier on the content administrator. At the cost of needing another administrative interface, somewhere, to teach Panels about what node templates are available.
This 'interface' might just be a theme hook, so a theme would do something like:
Any thoughts on this?
Comment #9
Letharion commentedSince this issue is very old, and has received so little attention, I'm closing it as fixed for now. Doesn't mean it will never happen, so if you have input on for example merlins suggestion, please feel free to re-open the issue.