How can I programatically enable the node_view system defined page? I would like to include this in my install profile?

Comments

kevinquillen’s picture

Hey,

After you enable Panels in your install profile, add this line:

variable_set('page_manager_node_view_disabled', 0);

That will 'Enable' the node_view override.

How did you import panels, if you did that? I can't figure out how to pull in 15 or so node_view variants.

kevinquillen’s picture

Well, I guess that doesn't work. It technically enables them but something is missing like a cache reset?

This didn't work for me this time around. Hitting disable then enable again got them displaying.

merlinofchaos’s picture

After setting the variable you will need to perform a menu_rebuild() -- that will finish it.

kevinquillen’s picture

Right you are. Just saw that after digging into Ctools.

So arcane, you would do:

<?php
variable_set('page_manager_node_view_disabled', 0);
menu_rebuild();
?>
arcane’s picture

Ok, Thanks, I will give it a try and report back.

merlinofchaos’s picture

FYI I would like this to become an API function, so anyone willing to dig in and see how that's done is welcome to roll a patch. NOt sure when I'll get to it myself, though I will eventually if no one else does.

arcane’s picture

Worked like a charm!

merlinofchaos’s picture

Title: Programatically enable » Add API function to programmatically enable and disable Pages.
Project: Panels » Chaos Tool Suite (ctools)
Version: 6.x-3.2 » 6.x-1.x-dev
Category: support » feature
merlinofchaos’s picture

Category: feature » task

Changing this to a task.

janusman’s picture

Can also confirm #4 worked for me; I was having problems using Panels rolled into a feature--the node template override was showing up as disabled after the installer finished. Adding those two lines after enabling the feature fixed it.

tanmayk’s picture

To enable user_view page, use: page_manager_user_view_disabled

colan’s picture

Version: 6.x-1.x-dev » 7.x-1.x-dev
Issue summary: View changes

#1837948: module from ctools bulk export not auto-enabling page manager page is related. I added info there on how to do this in an update hook, as it doesn't work with Features.