Question

I am working with a site that uses panels for layout. One of the simpler panels we have is used to show a node with sidebars around it with other content that changes dynamically based off of the path. The node and sidebars are always the same. Let's say the node id is 10 for the node that is always shown, that does not change.

For a specific path, I would like to change the body of node 10, the node that is always loaded through the panel configuration.

I thought of using preprocess_page in template.php and overriding $vars['content'], but that contains all of the html for the entire panel. I only want to change the body of the node that is always contained within the panel. Seems like having to override all of $vars['content'] just to change a small piece of the html within $vars['content'] is overkill.

How can I update the body of a node, that is always loaded by a panel, for only one path?

Was it helpful?

Solution

You could create a special condition for that panel page when the url is xxx.

Another option would be to override the pane that is printing the node with a preprocess function, and alter the html there. Similar to what you were trying to do, only targeting the thing you want to alter.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top