Closed (won't fix)
Project:
Panels Teasers
Version:
6.x-2.0-beta2
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Reporter:
Created:
27 Oct 2010 at 13:43 UTC
Updated:
11 Sep 2012 at 13:17 UTC
Some teasers are shown from view and different views may require different teaser layout. So idea is to pass view name with $node object so panels selection rules may use php code (or maybe later access plugin) to sort out which layout to render. Here is code in my head, I think Ill provide a simple patch later...
//Set a $node variable to prevent infinite looping
//Loads full node. Preprocessor only loads a teaser node.
$node = node_load($vars['node']->nid);
$node->panels_teasers = $vars['node']->panels_teasers = TRUE;
// If node is called from views, add its origin for selection rules.
if ($vars['node']->view) {
// This adds view name if node coming from views.
// Maybe we should add whole views object? Performance? Is it usefull?
$node->view->name = $vars['node']->view->name;
}
and then in selection rules you could use
if ($contexts['argument_nid_1']->data->view->name == 'VIEW_NAME_HERE') {
return TRUE;
}
return FALSE;
Works for me, will write patch when free time.
Comments
Comment #1
henrijs.seso commentedComment #2
jon pughProject is no longer supported.
Thanks for your interest!
Please see Display Suite for similar functionality.