Using content type URL Alias in Panels

228 views Asked by At

I am losing my mind, this should be easy.. Right?

a) I Do not want to use Node views/variants

b) I want to use Panels with a view in the main page section

URL Example: /cars/auto-generated-url-from-title

I can create a panel that overrides the /cars/% url, but there's no context settings which allow me to chose the autopath generated alias... At this point my mind is going numb.

I've tried using the Content: Nid but this doesn't work at all.. I was hoping that the autopath module would allow the Nid or the alias to trigger but it doesn't. I've seen other stack over flows of this question and frankly the "correct" answers must be for a different version of Drupal, Panels or both.

I am running Drupal 7.53, and Panels 3.8

Thanks in advance!

1

There are 1 answers

0
Ethode On

So, after toiling for a while I did figure this out. Part of the problem was me simply not understanding how Drupal handles autopath URLs

1) I disabled the custom layout page that was used on /path/%

2) I edited /node/%node and I added a variant.. This variant only triggers when node type equals the content type I'm working with

3) I created a view with a block display. This block display needs no URL. I have added just 1 context (Content: Nid). If you test this context you can see that you can search using the node ID, so 123, etc. This block does not respond to URLs and is included in content in the page panel

4) In the Content settings make sure and pass all arguments. By selecting this the panel will include the URL alias and the Nid ... and the page variant will override the default view/block system.