Can't believe I've never run into this but, I'm quickly realizing that the "node_view" page to take over my node pages doesn't use the 'view' $op for hook_nodeapi. So, modules that hook into that aren't being called. (i.e. menutrails module).
I know I can add node content to fake it, but then I'm not taking advantage of laying out my page the way i'd like.
Is the only solution to go ahead and use the "node being viewed" content and creating a tpl.php file for that node type? Does that defeat the purpose of using Panels to begin with?
thanks!
baby c
Comments
Comment #1
Letharion commentedHello!
Unfortunately, this issue has remained open, without activity, for a very long time. I hope you can understand that between maintaining the module, work, and other obligations, the maintainers are very busy. This leads to not all issues being answered.
In order to figure out who still actually needs help, I'm going over all low activity support requests that has not been touched for 6 months, and marking them "Postponed, needs info". In many cases, I expect the question to already have been answered, or become obsolete.
If you still care for this issue, please just reset it's status to active, and we'll try to help you. Please remember to post any new information that may be relevant, such as new versions of Panels that you are using, or own attempts at debugging.
Regards, Letharion
Comment #2
babycourageous commentedHi Letharion
Indeed this is an issue that still escapes me a bit. I've dug around the issue queue and couldn't find a solution (of which there might be none). I have some modules that fire on hook_nodeapi( $op = 'view' ). These aren't firing on my panels page node overrides because unless I add Node:Content, the 'view' $op doesn't fire.
I suppose an option is to create a custom module that calls hook_init and fire any code in there for those modules that are using hook_nodeapi('view') since hook_init is fired from panels pages. I'm just not sure how to call the right code per module or if this method is desirable.
Or should I add a dummy pane with Node:Content and create a tpl.php for that type to fire the 'view' $op so that I can create a page with CCK fields and View panes arranged the way I would like and thereby fire that 'view' for those extra modules (menutrails being one).
Hopefully that is some helpful information. I appreciate your time with this.
Thanks!
Comment #3
Letharion commentedNow that you mention it, it's a bit strange actually that so few have asked about this. On the other hand, I built everything with Panels, and never had a problem with this.
If I needed to solve this myself, I would probably create a custom Ctools plugin, of "content type"-type, and call something like node_invoke, or maybe node_invoke_nodeapi. I haven't tried this myself, so you'll have to experiment with this.
For ctools plugin examples, see the examples dir in the ctools project. Glad that you finally got an answer.
I'm settings fixed, but don't hesitate to reopen if you need to.
Comment #4
merlinofchaos commentedThe way I want to deal with this is to have a flag on the context object, and the context knows that it is going to be 'viewed' and will therefore run a content build automatically. That would solve this problem nicely by making sure the hooks get run.
Comment #5
babycourageous commentedThank you both so much for your input. @Letharion, I am surprised as well as the rarity of this in the queue but can also understand that I am using a lot of other custom modules that all fire on nodeapi('view') that are gumming up what would normally be a smooth as silk experience.
Both of your suggestions sound just outside of my scope of understanding of the CTools API/Plugin/Context architecture and language. I definitely do not want to take up any more of your time on this but if you could let me know if I am understanding you both correctly that would rule.
@Letharion: your solution is a "get my hands dirty writing a CTools plugin" solution (something I have never done and can imagine being quite an undertaking?)
@merlinofchaos: your solution is less a suggestion for me to enact and more of a forward thinking how you might like to see the module updated?
Again, thank you both so much for your help and insight on this odd experience. Cheers.
Comment #6
tsimms commentedI too am interested in this. It came up because I've been trying to change the behavior of my menus, using menu_set_item(). Everything I've come across has said to implement hook_nodeapi() or hook_node_view(), which seemed viable, but I was surprised to see that my functions weren't getting called. Here's part of the thread I'd followed:
http://drupal.org/node/520106
Does any type of workaround exist? Does the panel trigger any of the hooks where this functionality can be implemented?
Many thanks!
Comment #7
merlinofchaos commentedThe simple solution is to ensure that the node: content pane is in your panel.
If you don't want the data to show up, the hacky workaround solution is to create a content pane that has no output that nonetheless calls node_build_content so that the hook will be fired.
Comment #8
Letharion commentedBuilding a custom ctools plugin need not at all be "quite an undertaking". Mainly because ctools comes with a good set of examples.
Here's a quick hack that just received rudimentary testing, but it works for me on Drupal 7. Creates a "workaround" category, with a single content type in, which silently calls the node_build_content as merlin suggested, and then returns no output. Hopefully helpful :)
Don't know if it would require a lot of extra work to make it work on D6. Don't think so.
Comment #9
babycourageous commentedThanks @Lethrion.
I will try to take a look at this in the near future. I had something else come up on this project that shifted me into learning how to build a custom Views handler. As soon as I tackle it, I'll try this out.
Thanks for all your help.
Comment #10
Letharion commentedI'm not sure why you set the issue back to active though? I'm resetting the issue to fixed as I feel the issue has been answered/fixed to the extent it will, unless further questions come up. :)
Comment #11
babycourageous commentedStrange.
Sorry about that. Didn't purposely switch it.
thanks
Comment #12
tsimms commentedThanks guys, #7 worked for me.
Comment #14
OnkelTem commentedAddition to #7 and Drupal 7.
Install Entity API module and add "Entity" > "Rendered Entity" on a pane instead of node:content to get the hook called and the event triggered.
UPDATE: Added reference to Entity API module.
Comment #15
Letharion commented@#14 I believe that requires the entity api to be enabled, but yes, it's a good way to solve it.
Comment #16
OnkelTem commented@#15 thanks, updated.