Currently, Views supports the $node token in URLs. This token allows us to show tabs on nodes which belong to a certain type only; e.g.:
node/$node-story/similar
And this is indeed very handy. However, we are limited here to one node type. There are instances where our node may belong to either of several types.
I propose to extend the '$node' token to accept several node types; e.g.:
node/$node-story,news/similar
I'm attaching a patch.
Two additional fixes included:
1. Added two sentences of documentation. (Interestingly, I didn't find documentation for this feature in the handbooks; do you want me to start a page?)
2. Added a '2' limit to the explode() in views_menu_inline_items(). This isn't a bug per se, but it looked to me the Right Thing to do; else, theoretically, the token predicate can't get all the arguments.
| Comment | File | Size | Author |
|---|---|---|---|
| multtypes.diff | 1.76 KB | mooffie |
Comments
Comment #1
merlinofchaos commentedOn a cursory review, I like this patch. Yay!
To answer 1) It's not documented because the feature doesn't fully work. There are still areas in the code that assume the argument will always be $arg; they have to be fixed before I'd be willing to document this feature. I figure anyone who finds this feature will either 1) be told about it by me and thus I can warn them, or 2) is reading the code and is going to be able to deal with the problem.
I haven't had any time to work on Views 1 in a long time, so this thing has just kind of languished, but I'd happily accept a patch for Views 1.7 that fixes the $arg issues so that we can then document this feature.
Comment #2
mooffie commentedI hope to study the $arg issues next week and see what I can do.
Comment #3
summit commentedSubscribing, an progress in this field please?
greetings, Martijn
Comment #4
sunThis patch breaks existing implementations. It has to be backwards-compatible to be included.
Comment #5
esmerel commentedNo corrected patch submitted; issue hasn't been updated in a year and a half, nobody's working on 1.x.