I need help on how to manipulate node content when using Panels 3:
I have a rather complex CCK content type. This content type should be displayed using Panels. What fields to reveal to the user depends on a couple of visibility rules (like if the user has a certain user role). So I want to add these things as panels content and utilizes visibility rules. No problems so far.
But some of the content is more complex than simply showing a CCK field: I wish to add dynamic anchor links at the top of the page. In order to generate these links I will have to access and manipulate the full $node object.
But how can create a block that I can use to add content in a panel - not only a static block, but a block that can access the $node object an manipulate content from it? Like when you customize node.tpl.php.
Am I missing out some theming possibilities within Panels 3? Or is there a smart way to get around things?
And if it is possible to access the $node object: Can I minimize server load by not having to load the $node object for each part of content (I actualy need to use it in 4 content blocks with different visibility rules)?
Any help is highly appreciated.
Comments
Comment #1
merlinofchaos commentedYour best bet is to use the 'node content' block and the 'panel identifier' to create a custom node-panel-IDENTIFIER.tpl.php that will contain your custom links. It will have the entire $node so you can do whatever it is you need there.
Comment #2
bjaxelsen commentedThanks, Earl :-)
- thanks for great functionality and a quick and precise response - it was just what I needed
Comment #4
amcc commentedI'm using the 'node content' block and the 'panel identifier' as described above.
The problem i'm having is that the $node object doesn't include the title of the node - it seems to be missing even though there is a title. Any idea why this is and how i get the title. I need to use this templating method so i can use some logic to manipulate the title of the node.
Comment #5
amcc commentedjust solved the problem for myself - I needed to have 'Leave node title' checked in the 'node content' settings.
It does seem slightly odd that the title would be removed from the node object though
Comment #6
merlinofchaos commentedPanes want to render the title separately from the content. By default, nodes want to render the title with the content. That leads to a bifurcation. That checkbox is the easiest solution to get an either or, and let the site handle it automatically or not, depending upon how finely tuned it needs to be.
Comment #7
carlitus commentedI cannot use the custom template for a node pane using node-panel-IDENTIFIER.tpl.php and panels 3.2. With Panels 3.0 it works well.
I'm missing something or there is a new way to do this?
Comment #8
sblommers commentedSame problem here. custom templates don't work.
Comment #9
Dimm commentedhttp://drupal.org/node/334209#comment-3263848
Comment #10
amcc commentedMake sure you only add the IDENTIFIER bit in panels when you're adding the node content. Not the full filename (node-panel-IDENTIFIER.tpl.php).
Comment #11
mrconnerton commentedAre there any issues when adding a custom content pane and setting it to php to do:
I'm using panels for node layouts on ubercart products and this is how I am getting the product information.