I have a module that provides a number of pages to the Page Manager module using hook_default_page_manager_pages()
. This works out fine.
But now I would also like to provide a variant for the system included node/%node page
. But I can't find any hooks for providing variants.
My problem is, that I can not create my own page to overwrite node/%node, since this is already provided by the Page Manager module itself, so only way I can create pages that takes over the normal node view, is to provide a variant (from my understanding). But how can I do this programmatically? I can see that it's possible to export the variant, and therefore I guess that it would also be possible to provide it through a hook?
Is this possible in any way?
I found what I was looking for.
To provide variants for pages build with page manager in code, in your module file call hook_ctools_plugin_api(), to let Page Manager know, that it should listen to your module:
Now create a new file in your module root folder called MODULE_NAME.pages_default.inc. In this file you can now include the following functions:
and/or
I hope this helps another in need one day :o) Only thing I have left to discover is how my module programmatically can enable the node/%node page in Page Manager. If any one has a clue feel free to share it with me :)