Rather than passing in panel arguments directly, why not make them accessible by a token replacement like we do for URL arguments? With this patch, it makes it possible to access the arguments passed into views just like we do for URL arguments. In most scenarios, the panel argument and the URL argument will be the same, but if the panel is displayed programmatically (not by visiting the panel URL directly) this is no longer the case.
This patch makes it so URL arguments are accessible using the %0, %1, etc. method (no change there) and the panel arguments accessible using a new @1, @2, etc. method. Now you can rearrange panel arguments, even mixing them with URL arguments which may be different. i.e.
Arguments: [@1/%0/@0/desc]
Passes in arguments 1 from the panel, followed by argument 0 of the URL, then argument 0 from the panel and then the string 'desc'. This makes it so your views don't always have to have the exact parameter order as your panel (or you can skip some arguments if desired).
Earl, I know talked about a solution to this problem at length, this solution seemed so simple I figured I let you take a look at it. Thanks!
| Comment | File | Size | Author |
|---|---|---|---|
| panels_arguments.patch | 1.77 KB | quicksketch |
Comments
Comment #1
merlinofchaos commentedComment #2
(not verified) commentedComment #3
socialnicheguru commentedthis is a great description of panel arguments and should go in the documentation.
Chris