Splitting this off from #1100922: Drupal 7 port of Panelizer...

Included in the initial D7 port that was committed was a hunk that implements hook_node_view() so that the panels display gets rendered when viewing a node without using page manager and enabling the node template. I don't think that was a good idea to include in the port. It needs more discussion about if/how we want to handle this, and if this behavior should be back-ported to D6 or not. It also has implications for #1170264: Add a views row style plugin to render panelizer nodes since that feature might not be necessary at all if we did this properly. So, let's discuss for real before we get any further. ;)

Thanks,
-Derek

Comments

cangeceiro’s picture

I dont think i have much preference on which way it goes. relying on page manager is going to add another dependency layer, and should be documented well as I could see users getting confused by this. It wasnt even clear to me that this is the expected configuration after digging thru the code. hook_node_view just keeps it simple. What implications does this route have as opposed to going with page manager?

merlinofchaos’s picture

Utilizing hook_node_view the way that the initial patch does is somewhat against my original intentions.

1) It just replaces $node->content['body'] meaning anything else that gets attached to the node will automatically render outside the node. This is not what I was thinking people would want.
2) Similarly, going through this route means it will ultimately be rendered via node.tpl.php meaning title, author, etc will also be rendered outside the panel.

Now, I think all of these things can be overcome; replacing $Node->content entirely (and storing a copy so that an 'inner' node_view would render that instead) and maybe adding a preprocess to theme_node to automatically render panelized nodes in a stripped down node.tpl.php

dww’s picture

@merlinofchaos: Thanks for the reply. As per our chat, I reverted this change in the 7.x-1.x branch until we have a more fully-fleshed out solution here.

@cangeceiro: What do you think about tackling all of Earl's concerns? Want to work on a patch and see how far you get? If this is done right, it renders #1170264: Add a views row style plugin to render panelizer nodes obsolete. Also, based on my chat with Earl, we both agree that whatever happens in here needs to be implemented for both D6 and D7. Are you up for that, too?

Thanks!
-Derek

cangeceiro’s picture

I'll start looking at this, might take me a little longer then some of the other code i have brought back here though. This one will take some thought.

cangeceiro’s picture

After a few days of tinkering with this. I am not really able to find a clean way to make this happen. Maybe page manager is a better avenue?

dww’s picture

Right. ;) page manager is exactly how this already works in D6 (and presumably in D7). Also, I wrote code at #1170264: Add a views row style plugin to render panelizer nodes so you could at least have a view of panelized nodes that display their panel, not the node itself (my use case there is a view of a nodequeue to use for the front page of a site, so you can swap out different panelized nodes as the layout of the front page -- my forthcoming panels_edition module). Anyway, if this is a rathole, I'm happy to continue with page manager, my views row style plugin, and better documentation.

cangeceiro’s picture

Status: Active » Closed (won't fix)

I would say so, any implimentation that i could come up with is hacky at best so it sounds like page manager is the way to go.