I have a module that is being used to create only a few page nodes (done in .install). That’s working fine. The problem is that these nodes contain xml, json, jsonp content, so I want to be able to render them without the theme, no header, no footer, no styling, just node->content.
This module is going to be shared with several other Drupal sites so I can’t do this with theme development, I don’t want anyone to have to create or modify templates.
Is there a way to do this using a hook from within the module, the .module? Basically detect the node title or node alias (or something) and then prevent the theme from rendering and only render the content. I’ll know the titles and aliases of the nodes because I’m creating them in the .install.
I would also like to modify the headers to correctly to say tell whats being returned is xml, json, etc.
Thanks in advance.
Normally, I’d go about this another way. I’d define the content through
hook_menu()menu router items rather than as node content, as it’s rarely intended to be directly user-editable. If there is a lot of processing, you can separate it from the .module and include it as afilefor each item.