5

I am a little new to Panels, but I am using it to manage layouts for different content types and it is working out really well. However I want to be able to create a page variant that will only target a single node. Is there any way to do this based on the node's id?

0

What you probably want to do is use Panelizer.

Page manager itself can do it to, but I don't see a builtin rule to match on node ids. Copying an existing rule, such as ctools/access/node_language.inc would probably be the best way to solve that. See What are Ctools plugin (content type, access, etc), and how does one create them? for more details.

8

Assuming you already have the node override Panel enabled:

  • Edit the panel page for the node override (node_view for node/%node)
  • Make a new variant, enable selection rules
  • For the selection rule, choose String: Url Path
  • In the criteria, keep Allow access on the following pages selected
  • In the textarea, add the internal node paths for this nid(s) you want. To target nid 1234, use

    node/1234

  • Configure the test of the panel as needed.

Just make sure this comes before any less-specific rules, like matches on content type.

  • Bah! How could I not have thought of that? +1 – Letharion Nov 15 '13 at 19:55
  • @Letharion I had to double check this on a few sites. I haven't done this in a while, and was a little baffled that there isn't a node selection plugin that just lets you pick a node or enter a nid directly. – mpdonadio Nov 15 '13 at 22:39
  • Please, check out another solution: stackoverflow.com/questions/2356356/… – Roger Sep 16 '15 at 12:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.