Can I have the same panel page path (node/%) with different displays for different content types?

Events happening in the community are now at Drupal community events on www.drupal.org.
kirilius's picture

I have two node types: A and B. Obviously they both have the same default path in Drupal, which is the generic "node/%".

I would like to override BOTH A and B with a panel page of its own. Obviously both panel pages will require the Node ID context and Panels allows me to specify for which content type I want the display overridden.

It also seems obvious that both panel pages should have the same path much like different node types share the same "node/%" path. But for Panels that is a conflict and it's not letting me do that. The way it looks to me is that Panels allows for overriding of one node type only?!

So my question is: how can I override the display of two different node types with Panels?

Comments

yes you can. Arguments:

bennos's picture

yes you can.

Arguments: NodeID

When you create the argument or editing, then you can choose in the ajax pop-up the content types. You must choose also the own display checkboxes for every content type you need.

after safeing, you see under content all activated content types.

That's true, but if I update

kirilius's picture

That's true, but if I update the content for one content type and save, then all other content layouts are also updated. That's the thing: I need different content displays for different content types.

certainly possible

dagomar's picture

Not sure what your issue is exactly. You can make a different display for each node type. In contexts you select the nodeID Argument, and you select "Own display " for each node type that you want to create a different panel layout for. After, you can create a 'default' panel for nodes, and panels for each node type...

I git it finally. Initially

kirilius's picture

I got it finally. Initially I thought you have to create a different panel page for different content types.

thnx

imDhaval's picture

thnx

I'm trying to follow this.

IWasBornToWin's picture

I'm trying to follow this. What if you want to show 2 different displays of the same node type? One display with one view, and another with a different view of the same node type.

I tried to add another variant and use url selection rule....but no luck.

IWasBornToWin, what are you

dagomar's picture

IWasBornToWin, what are you trying to accomplish exactly?

I'm currently using panels

IWasBornToWin's picture

I'm currently using panels node template to view single nodes of certain content type. I created custom views for the node fields and then added the views to the panel in the content section. In panel layout, the content currently looks like this;


custom node view


custom comments view


comment form

Now I've created another custom node view (showing only part of the fields in the first custom view) and I'm trying to use panels to view the same node just in a different way now...like this;


another custom node view


custom comments view


comment form

Since all my default nodes are displayed in the original panel layout I made the new custom view as a page with a url (/node/%/newdisplay) I even tried /newdisplay without node being in url.
I've tried adding another variant(with url selection rule), i've tried creating a new panel page for nodes. I simply can't get this new view to show in a panel. I can go to the custom url and see the view page....it just never gets shown through panels.

Thank you so much for the quick reply.

So the only difference is the

dagomar's picture

So the only difference is the url? How about creating a new panel, with this:

whatever/%

And then add node as an argument? I'm pretty sure that works.

I tried that and tried to add

IWasBornToWin's picture

I tried that and tried to add the node as an argument.....but it only gave me the option of choosing a specific node id. I need it to show whichever node id is pulled from the url.(which is a contextual argument within the view)

Getting closer. I created a

IWasBornToWin's picture

Getting closer.

  1. I created a new panel, gave it a url transfer1/%node.(it wouldn't allow just transfer1/%...said i needed to add something behind it)
  2. Created an argument %node = Node ID.
  3. Added new custom view to panel content.
  4. Added comment form underneath.

when I go to site.com/transfer1/20 I only see comment form, no node fields(from new custom view).

If I go back to the view, remove the contextual filter (to show only node which matches node id in url) then all nodes show at site.com/transfer1/20

Got it!

IWasBornToWin's picture

Not sure why but I had to change the panel url to node/%node/transfer1

Apparently even though the argument in the panel says %node = Node ID, the view contextual filter must not equate %node as id. unless /node proceeds it...who knows. My head hurts, been working on this all day. I really appreciate your quick feed back.

Thanks

did you pass on the argument

dagomar's picture

did you pass on the argument to your view when u added it to your panel? Otherwise, do u have a sandbox which I could have a look at?

Don't know if this is useful,

capellic's picture

Don't know if this is useful, but you can give the editor the ability to choose the panel layout for a given node using Display Suite.

Panels

Group organizers

Group notifications

This group offers an RSS feed. Or subscribe to these personalized, sitewide feeds: