Hi,
I use views to browse children terms of a specified terms. It works pretty well except the page title.
I looked into the taxonomy_term default view to see how to set up the view to set the title as the term name instead of the term ID.
The default taxonomy_term views have a TID argument, and %1 as title, and it show the term name as title with a path like that : taxonomy/term/3
My view, that have a path like that : category/%, a TID argument and %1 as argument title show me a page with the title "3" with a path like that : category/3...
Why my views don't convert term TID into Term name as title whereas the taxonomy_term view do it ?
| Comment | File | Size | Author |
|---|---|---|---|
| #7 | 338893-taxonomy-argument-title.patch | 422 bytes | dawehner |
Comments
Comment #1
zmove commentedI'm still looking for a clean solution.
The only way I found is to create a temporary view title, to have the $title variable not empty in views-view-grid.tpl.php
And then, load the TID argument (arg(2)), load the term that have the tid of the argument, and show the $term->name instead of $title variable...
I think there is a cleaner way to do it, but didn't find it. Still looking for help.
Thanks
zmove
PS : It would be cool to have the value of the title in the $title variable when using arguments, instead of a hardcoded drupal_set_title. It would avoid the fact to be obliged to put a temporary title to be able to override it.
Comment #2
merlinofchaos commentedThe validator is probably what's converting the title, though the argument is supposed to do it too.
Comment #3
merlinofchaos commentedHm. I just tested this without the validator, and the title translation still happens.
Can you export your view?
Comment #4
zmove commentedYes, no problem Here is it :
I tested different configuration with arguments, without success. I would add that I would prefer to use tid instead of term name for argumens, it's quicker and safer IMHO.
Thank you for support.
Comment #5
merlinofchaos commentedStill valid. The reason this happens is that this is a taxonomy term view, not a node view, and thus it uses a different handler.
The argument just uses the generic numeric handler and does not actually process the title, which is the problem. Using the taxonomy validator could work around this issue easily enough, but the bug should be fixed. I think we can set the title field to 'name' without creating a new handler.
Comment #6
yugene commentedHere is my quick solution:
1. Don't set title in views
2. in template.php
Comment #7
dawehnerHere we go.
Comment #8
merlinofchaos commentedCommitted to D6. Needs porting to D7.
Comment #9
dawehnerPorted and commited.