Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
How can I programatically enable the node_view system defined page? I would like to include this in my install profile?
Comments
Comment #1
kevinquillen CreditAttribution: kevinquillen commentedHey,
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.
Comment #2
kevinquillen CreditAttribution: kevinquillen commentedWell, 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.
Comment #3
merlinofchaos CreditAttribution: merlinofchaos commentedAfter setting the variable you will need to perform a menu_rebuild() -- that will finish it.
Comment #4
kevinquillen CreditAttribution: kevinquillen commentedRight you are. Just saw that after digging into Ctools.
So arcane, you would do:
Comment #5
arcane CreditAttribution: arcane commentedOk, Thanks, I will give it a try and report back.
Comment #6
merlinofchaos CreditAttribution: merlinofchaos commentedFYI 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.
Comment #7
arcane CreditAttribution: arcane commentedWorked like a charm!
Comment #8
merlinofchaos CreditAttribution: merlinofchaos commentedComment #9
merlinofchaos CreditAttribution: merlinofchaos commentedChanging this to a task.
Comment #10
janusman CreditAttribution: janusman commentedCan 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.
Comment #11
tanmaykTo enable user_view page, use: page_manager_user_view_disabled
Comment #12
colan#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.