Hello,
In a website, I use taxonomy display and views for the display of four different vocabularies. In each case described below I use "Override title" setting in order to define (customize) view's (term's) title.
I have the following problem:
- In the first case I use the same url prefix i.e. taxonomy/term/%, for all four vocabularies.
Due to the fact that I want four different titles for each vocabulary I create four view pages with the same url prefix but different Contextual filter settings (has taxonomy term id-> specify validation criteria by vocabulary). I use "Override title" setting to achieve my goal.
In this case the "Override title" setting works but only for the first (out of four) views. For the other three vocabularies I get a page not found (because drupal tries to load them through the first view).
- In the second case I use unique url prefixes i.e. voc1/%, voc2/%, voc3/% and voc4/%
In this case the "Override title" is being ignored by drupal and although taxonomy display works, the titles in the term page are by default the term name e.g. "Term 1"
Due to this behavior, I guess that the problem is related with the default url prefix for taxonomy term which is taxonomy/term/%
However, I cannot find a solution in order to customize the title of my vocabulary displays and therefore I ask your help.
Thank you for your time in advance,
mike
| Comment | File | Size | Author |
|---|---|---|---|
| #5 | taxonomy_display-set_page_title_from_view_title-1754636-5.patch | 1.32 KB | vidorado |
| #3 | 0002-Override-term-page-title-from-view-s-title.patch | 924 bytes | vidorado |
Comments
Comment #1
codycraven commentedmike27,
This really doesn't have anything to do with this module, however I can tell you need help and have provided a solution below:
The simplest solution to your problem would be to use Panels, which already has support for setting titles with tokens (think override title).
What you would do is enable term_view under admin/structure/pages, then you'd create variants of the panel for each vocabulary and do whatever configuration you're desiring to do there.
The reason using multiple Views with the same path taxonomy/term/% is not working is because there can only be one authoritative owner of a path. In this case whichever View the Views module is deciding is the owner is the one that returns the response, it won't iterate over each View with that path.
If you need more help please use the IRC channel, as again, your problem doesn't have anything to do with the Taxonomy Display module.
Comment #2
vidorado commentedThis is not related directly to the main question but i think it's important:
When you use Taxonomy Display, your views mustn't use the URL "taxonomy/term/%". Taxonomy Display will use the view you choose for each vocabulary whatever URL that view has. This is important when you use Taxonomy Display in more than one vocabulary, because if you only use one and set your view URL to taxonomy/term/%, it would seem that everything is working ok, but really the view is overriding and skipping taxonomy display behavior. But as i said, you will only notice this when you use more than one vocabulary (and different views for each one) and you see that the same view is always used.
Comment #3
vidorado commentedI noticed that page title was being set always as the term name, although the view used for content display had it's own title. That was a problem for me because i needed to use contextual filters page title overridings and it were being ignored.
This simple patch solves the problem for me. It applies to 7.x-1.1 release.
Comment #4
codycraven commentedvidorado, thanks for the patch.
I think we should include an option in the associated content Views plugin to use the title from the View as the page title.
Comment #5
vidorado commentedHere the patch, with configurable option added ;)
It applies to 7.x-1.1
Comment #6
jay-dee-ess commented#5 works great. Thanks!
Comment #7
codycraven commentedFantastic I'll commit it, thanks for the review jay-dee-ess.
Comment #8
bessone commentedGood patch, but works only with the page title and not with the html title tag. Is a deliberate choice or is it a bug?
Comment #9
vidorado commentedI've just tested it and the <title> tag content matches the page title (but with html tags stripped), what is the expected behavior.
¿Are you overriding your <title> tag using Page Title module, Metatag module or something else?
Comment #10
codycraven commentedH-BES that would be a deliberate choice. Titles can not contain html.
Comment #11
codycraven commentedH-BES that would be a deliberate choice. Titles can not contain html.
I've committed the patch in #5.
Comment #13
philyThanks you for patch #5 which works on 7.x-1.1 release.