Take Over Page Output from Module
The Print module, Book module's export functionality, the s5 module, they all have this trick of taking over the entire page output for their own theme function. I am building a module that is headed toward a more generic mechanism for funneling content through a pluggable template, but despite pouring over the code I can't see the magical place where all other Drupal markup is dropped in favor of the HTML document described in my own template file. What's the trick? I have a menu callback along the lines of "present/%node" and it leads to an export function that returns my theme function, which is a template outputting a complete HTML document.
Are you looking for hook_menu_alter() ? All the Best, Matt Chapman On Thu, Jul 8, 2010 at 4:48 PM, Adam B. Ross <grayside@gmail.com> wrote:
The Print module, Book module's export functionality, the s5 module, they all have this trick of taking over the entire page output for their own theme function.
I am building a module that is headed toward a more generic mechanism for funneling content through a pluggable template, but despite pouring over the code I can't see the magical place where all other Drupal markup is dropped in favor of the HTML document described in my own template file.
What's the trick?
I have a menu callback along the lines of "present/%node" and it leads to an export function that returns my theme function, which is a template outputting a complete HTML document.
I'm afraid not. I'm looking to take complete control over the output of a menu path I have already defined in hook_menu(). I want behavior similar to what happens when you click the link to print a book, and you get a print-styled, alternate version of a book and all it's children. On Thu, Jul 8, 2010 at 4:51 PM, Matt Chapman <matt@ninjitsuweb.com> wrote:
Are you looking for hook_menu_alter() ?
All the Best,
Matt Chapman
On Thu, Jul 8, 2010 at 4:48 PM, Adam B. Ross <grayside@gmail.com> wrote:
The Print module, Book module's export functionality, the s5 module, they all have this trick of taking over the entire page output for their own theme function.
I am building a module that is headed toward a more generic mechanism for funneling content through a pluggable template, but despite pouring over the code I can't see the magical place where all other Drupal markup is dropped in favor of the HTML document described in my own template file.
What's the trick?
I have a menu callback along the lines of "present/%node" and it leads to an export function that returns my theme function, which is a template outputting a complete HTML document.
Ah ha. In that case, there's nothing to take over. Just print your output and return nothing from your page callback. See: http://api.drupal.org/api/function/page_example_foo/6 All the Best, Matt Chapman On Thu, Jul 8, 2010 at 4:55 PM, Adam B. Ross <grayside@gmail.com> wrote:
I'm afraid not. I'm looking to take complete control over the output of a menu path I have already defined in hook_menu(). I want behavior similar to what happens when you click the link to print a book, and you get a print-styled, alternate version of a book and all it's children.
On Thu, Jul 8, 2010 at 4:51 PM, Matt Chapman <matt@ninjitsuweb.com> wrote:
Are you looking for hook_menu_alter() ?
All the Best,
Matt Chapman
On Thu, Jul 8, 2010 at 4:48 PM, Adam B. Ross <grayside@gmail.com> wrote:
The Print module, Book module's export functionality, the s5 module, they all have this trick of taking over the entire page output for their own theme function.
I am building a module that is headed toward a more generic mechanism for funneling content through a pluggable template, but despite pouring over the code I can't see the magical place where all other Drupal markup is dropped in favor of the HTML document described in my own template file.
What's the trick?
I have a menu callback along the lines of "present/%node" and it leads to an export function that returns my theme function, which is a template outputting a complete HTML document.
I feel as though I must have tried it. But it worked like a charm. I owe you a beer. On Thu, Jul 8, 2010 at 5:01 PM, Matt Chapman <matt@ninjitsuweb.com> wrote:
Ah ha. In that case, there's nothing to take over. Just print your output and return nothing from your page callback. See:
http://api.drupal.org/api/function/page_example_foo/6
All the Best,
Matt Chapman
On Thu, Jul 8, 2010 at 4:55 PM, Adam B. Ross <grayside@gmail.com> wrote:
I'm afraid not. I'm looking to take complete control over the output of a menu path I have already defined in hook_menu(). I want behavior similar to what happens when you click the link to print a book, and you get a print-styled, alternate version of a book and all it's children.
On Thu, Jul 8, 2010 at 4:51 PM, Matt Chapman <matt@ninjitsuweb.com> wrote:
Are you looking for hook_menu_alter() ?
All the Best,
Matt Chapman
On Thu, Jul 8, 2010 at 4:48 PM, Adam B. Ross <grayside@gmail.com> wrote:
The Print module, Book module's export functionality, the s5 module, they all have this trick of taking over the entire page output for their own theme function.
I am building a module that is headed toward a more generic mechanism for funneling content through a pluggable template, but despite pouring over the code I can't see the magical place where all other Drupal markup is dropped in favor of the HTML document described in my own template file.
What's the trick?
I have a menu callback along the lines of "present/%node" and it leads to an export function that returns my theme function, which is a template outputting a complete HTML document.
I think you are probably interested in template suggestions. Try reading up in overriding themeable output... http://drupal.org/node/223440 On 09/07/2010, at 9:55 AM, Adam B. Ross wrote:
I'm afraid not. I'm looking to take complete control over the output of a menu path I have already defined in hook_menu(). I want behavior similar to what happens when you click the link to print a book, and you get a print-styled, alternate version of a book and all it's children.
On Thu, Jul 8, 2010 at 4:51 PM, Matt Chapman <matt@ninjitsuweb.com> wrote:
Are you looking for hook_menu_alter() ?
All the Best,
Matt Chapman
On Thu, Jul 8, 2010 at 4:48 PM, Adam B. Ross <grayside@gmail.com> wrote:
The Print module, Book module's export functionality, the s5 module, they all have this trick of taking over the entire page output for their own theme function.
I am building a module that is headed toward a more generic mechanism for funneling content through a pluggable template, but despite pouring over the code I can't see the magical place where all other Drupal markup is dropped in favor of the HTML document described in my own template file.
What's the trick?
I have a menu callback along the lines of "present/%node" and it leads to an export function that returns my theme function, which is a template outputting a complete HTML document.
participants (3)
-
Adam B. Ross -
Chris Skene -
Matt Chapman