Hi there!

First of all: Panels 2 is a awesome module. Thanx so much for this essential piece of code!

My Probelm:

I am using pathauto to generate my url aliases.
My node path setting is:
video/[type-name]/[title-raw]

My panel path setting is:
node/%
Everything is working fine.

Now i want to use a different panel page for every conent type.
So i changed my pathauto config to pass the nid.
video/[type-name]/[nid]/[title-raw]

And set my panel path to
video/my_contenttype/%

but it doesn't work because of the title which comes after the nid.
If i remove the title manually in the browser url, it works.

Can i set something like a wildcard that panels ignores the title after the nid?
Something like video/my_contenttype/%/*

Sorry if this is a pathauto issue!

Comments

alexkessler’s picture

Sorry to bother everybody, but i dont know what i am doing wrong.

I set up a complete fresh installation. only panels beta2 and core modules (no pathauto).
Add a panel page with a path like video/%/music and a node with the same path alias eg. video/12/music
and published it to the frontpage.

If i understand the handling of arguments correctly the link from the frontpage should pass the node id to the panel,
but it doesn't work.

If i go to the preview tab in panel pages and pass a node id manually it works.
So it have to be the url alias.

I am shure i use this method a several time with views and it works.

Maybe this is s quite simple question but i have no clue how to do.

Funny is that if i am adding something behind the url in the browser bar manually (something like video/12/music/anything) it works.

Oghnia’s picture

I would to know how this can be done too!

ineation’s picture

May be I am wrong but I think that url aliasing has no impact on the way Panels works.

If you want to use different panels for different content type you can do it easily by :
1) Creating a panel that override node : "node/%" don't worry url alias will still work
2) In the context tab put node id as an argument : then in the form select a) The content types you wish to override b) the content types that should have their own display
3) Then add all the content you need : notice that you have one tab per content type so that you can design one display per content type

And normally it should work even with url alias.

Ok for you ?

merlinofchaos’s picture

Status: Active » Fixed

Ok, so the problem that you're experiencing is that you're not quite seeing what the aliasing does. Let me explain.

Let's say I have a url. It can be any URL, but for this example it's "node/12".

Let's say I have an alias and it's generated by pathauto, and it's something like video/type/12/this-is-the-title-of-the-video and it's aliased to "node/12"

If I visit http://example.com/video/type/12/this-is-the-title-of-the-video then what Drupal thinks the URL was was, in fact, 'node/12'. Panels never has a chance to do anything with video/type/12/foo because that URL doesn't really exist.

The reason, then, that adding some other piece to the URL makes it work is that aliases don't accept arguments. They must be exact. So the problem, in that case, is the alias itself is actually taking the page away from where you want it to go.

alexkessler’s picture

I was wondering why adding a piece of url makes it working. Now i know...
Thanks merlin for the explanation.

In the meantime i configured my panels like ineation described in post #3.

Anonymous’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.