Download & Extend

Add API function to programmatically enable and disable Pages.

Project:Chaos tool suite (ctools)
Version:6.x-1.x-dev
Component:Code
Category:task
Priority:normal
Assigned:Unassigned
Status:active

Issue Summary

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

Comments

#1

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.

#2

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.

#3

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

#4

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();
?>

#5

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

#6

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.

#7

Worked like a charm!

#8

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 request» feature request

#9

Category:feature request» task

Changing this to a task.

#10

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.