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

merlinofchaos’s picture

Well. 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.

sun’s picture

Status: Active » Postponed (maintainer needs more info)

Is this still an issue? Did you update to the latest release?

michelle’s picture

Status: Postponed (maintainer needs more info) » Closed (fixed)

No answer to #2. Closing.

Michelle

interestingaftermath’s picture

Status: Closed (fixed) » Active

Any 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?

michelle’s picture

@interestingaftermath: 5.x is not supported anymore.

Michelle

merlinofchaos’s picture

Status: Active » Closed (fixed)
interestingaftermath’s picture

Version: 5.x-2.0-beta2 » 6.x-3.3
Status: Closed (fixed) » Active

I'm sorry. I forgot to update the Version. This question is still relevant for 6.x. Is it possible?

merlinofchaos’s picture

Category: support » feature

Unfortunately, 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:

  MYTHEME_ctools_node_templates() {
    return array(
      'node-big' => t('The big template'),
      'node-small' => t('The small template'),
      'node-special' => t('The very very specialized template')
    );
  }

Any thoughts on this?

Letharion’s picture

Title: forcing node templates on content regions » Forcing node templates on content regions
Version: 6.x-3.3 » 7.x-3.x-dev
Status: Active » Closed (won't fix)

Since 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.