Panel Pages Without Arguments?

We encourage users to post events happening in the community to the community events group on https://www.drupal.org.
mpdonadio's picture

OK, not sure if I am searching on the wrong things, but didn't turn up any info on this.

I have a Drupal 6 running latest stable of Panels 3.x and dependencies.

I have a Panel Page set up with a path like /foo/bar, and the page does not accept any arguments.

Is there a way to make a URL like /foo/bar/baz generate a 404 instead of rendering the same page as /foo/bar?

I suspect I can call page_manager_get_current_page() from the page proprocess, figure out which panel page I am on, and call drupal_not_found() as needed, but could get ugly on a big site with lots of panel pages.

Any other ideas / suggestions? Thanks.

Comments

Make your path

merlinofchaos's picture

Make your path foo/bar/!baz

Go to arguments and set baz to the string context.

Then in the access settings add the 'context empty' rule on baz.

Wow! An exclamation point?

alexrayu's picture

Merlin, please confirm that it's !baz rather than ?baz

It's !baz -- the only two

merlinofchaos's picture

It's !baz -- the only two argument URL portions that Page Manager supports are %name (i.e, %baz) for a required argument, and !name (i.e, !baz) for an optional argument.

You want to pick the optional argument so that the URL will work without it. %baz would require it.

?baz would be a query string and Page Manager has no concept of how to deal with query string parameters at all.

Thanks!

alexrayu's picture

Thanks!

Generate 404?

mpdonadio's picture

This worked for me, but I got a 403 / Access Denied. Is there a way to make it 404 / Not Found? Thanks.

In the -dev version of

merlinofchaos's picture

In the -dev version of CTools, there is a variant named "HTTP Response Code". Instead of using the access control, you could add a HTTP Response Code variant that uses a 404 with the rule you used as the selection criteria.

Panels + Views

alexrayu's picture

I one of my clients has requested that I implement in a panel page an AJAX calling a view. The view has a pager. Because it is loaded dynamically into a panel, the pager takes one to the home page rather than paging in a right way. Is there a way to pass right URL from the panel page to the views pager? How does the pager know that at all?

A bit late, but...

Zero4ffect's picture

A bit late, but...
Instead of using AJAX to call the view try creating a views pane instead. When creating the pane, in the Pane Settings section, set the "Use Panel path" option to Yes. After you insert that pane into the panel in question your issue should be remedied.

Panels

Group organizers

Group notifications

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

Hot content this week