Programatically enable

arcane - October 22, 2009 - 13:05
Project:Panels
Version:6.x-3.2
Component:Code
Category:support request
Priority:normal
Assigned:Unassigned
Status:active
Description

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

#1

stripped your speech - October 26, 2009 - 13:49

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

stripped your speech - October 26, 2009 - 15:17

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

merlinofchaos - October 26, 2009 - 17:08

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

#4

stripped your speech - October 26, 2009 - 17:28

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

arcane - October 26, 2009 - 17:59

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

#6

merlinofchaos - October 26, 2009 - 18:01

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

arcane - November 2, 2009 - 02:54

Worked like a charm!

 
 

Drupal is a registered trademark of Dries Buytaert.