Closed (fixed)
Project:
Taxonomy Views Switcher
Component:
Code
Priority:
Normal
Category:
Task
Assigned:
Reporter:
Created:
26 Apr 2011 at 10:20 UTC
Updated:
18 May 2011 at 08:49 UTC
Jump to comment: Most recent file
Hi,
I made some changes to your tvs module:
- I added hook_install, to call tvs_menu_alter after views_menu_alter, so that having taxonomy/term/% view enabled is no longer neccessary
- a core taxonomy/term page is displayed if no suitable view is found in taxonomy_views_switcher_get_view()
- a view with path: switch/vid/[vocabulary_machine_name] (in addition to switch/vid/[vid]), is handled (it's easier to get vocabulary machine name that vid)
I can provide a patch to your repository if you want (see http://drupal.org/node/707484)
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | suggested_changes-1138580-1.patch | 4.83 KB | pgorecki |
Comments
Comment #1
simg commentedHey, thanks Przemysław, sounds cool :)
If you post the patch, I'll apply it (might take a week or so as I'm currently on holiday after a "fairly" busy 3 months)
Thanks :)
Comment #2
pgorecki commentedHere's the patch + taxonomy_views_switcher.install file below:
Comment #3
simg commentedThanks Przemysław. Have updated the repository.
I've also added the ability to specify a path of switch/tid[tid] or switch/tid/[term name] to allow different views for specific taxonomy terms.
The code now matches views in the following priority order (highest priority first):
1. Matches against the term id or name (switch/tid[tid])
2. Matches against the vocabulary id or machine name (switch/vid/[vid])
3. Matches against the request path (eg request_path() )
(The term name matching code is a bit weak as it uses just the name rather than the alias, but I was in a hurry and I'm not sure if anyone is going to use this functionality anyway?)
Comment #4
simg commented