We use the view to emulate Drupal core's handling of taxonomy/term. When I put a custom title under Metatags > Page Title, Drupal still uses the taxonomy term name for its page title.

The description, keywords are working correctly and on node pages there is also no problem.

I am working with Drupal 7.23 and tried with metatag version 7.x-1.0-beta7, 7.x-1.0-dev and latest snapshot from the repository. My theme is ninesixty.

I also dived into the code, but couldn't find anything. Your advice is highly appreciated.

Don't know if it helps: on beta4 + patch 1845326-102 it worked ok, but that patch is already committed.

Comments

DamienMcKenna’s picture

I've got a patch brewing that'll resolve problems loading terms, gimme a few days and this should work.

immoreel’s picture

Any updates on this issue?

corneboele’s picture

Regarding this issue; when I disabled the metatag_views module, it suddenly started to work again.

Jboo’s picture

Having a similar issue. Overridden taxonomy terms using views won't display any custom entry to page title or description. Without the Metatag views module the views takes on the default global settings. Looking forward to getting this working. All other nodes and front page metatags work.

ficklecat’s picture

Also having issues with this, taxonomy pages not showing custom meta tags (title or description) just the default. Hope to see an update on this, I can't figure it out.

gdana’s picture

Hey,

This is a real problem, is there any version (either dev or one of the latest betas) where the page title works in taxonomy pages using views?

If not, is there any kind of workaround for now until there is a patch, some code that can be placed in the template.php file that will make these variables available for the theme's template files?

Thanks

rag_gupta’s picture

Subscribing..

flaviamarcus’s picture

Issue summary: View changes

Hello, it seems that i have the same problem. Did someone came up with a solution?
Thanks.

saorab’s picture

Had the same issue. I disabled the metatag_views module, and added
print render($page['content']['metatags']);
to page.tpl.php and page--taxonomy.tpl.php

and it worked. !!!

killes@www.drop.org’s picture

Anybody got an idea where one would look in order to fix this? I am trying to use metatag on taxonomy-panel-pages and it's just not working for the title.

DamienMcKenna’s picture

There are several problems when using Views to control taxonomy term pages, none the least that Views *always* assigns something via drupal_set_title() for page displays. The problem might be solvable by adjusting the module weights, but I've not tested the theory. I'm also considering changing Metatag to use drupal_set_title instead of the current theme-driven structure, but I've not tested that.

I've also not tested the different options when using Panels, it's something I need to do but I've been focusing on Panelizer & related modules for the past while; I'm hoping in early May I'll be past most of that work and will be able to get back on Metatag.

killes@www.drop.org’s picture

I've tried playing with the weights, but that didn't get me anywhere. All I could achieve was to not have a title at all. ;)

killes@www.drop.org’s picture

If I print out the input to mytheme_html_head_alter() I do see various metatag_* items like metatag_description, but _not_ metatag_title. Very strange.

DamienMcKenna’s picture

Component: User interface » Views integration
ron_s’s picture

Just wanted to add to the discussion in case anyone else is having this issue. We originally cloned the core "Taxonomy term" view so we could suppress display of several vocabularies using the "Has taxonomy term ID (with depth)" contextual filter.

By simply cloning the view, it caused Metatag Page Title overrides on taxonomy terms to stop functioning. The Page Title was always shown as the default generated via views. As soon as we deleted the cloned "Taxonomy term" view, the Page Title overrides started functioning correctly.

As a side note, when using the Page Title module with Metatag, the page titles are displayed correctly -- even when the "Taxonomy term" view has been cloned.

buddyfinton’s picture

Are there any other solutions or any patches for this issue? We are having the same issue and the solutions outlines here do not work for us.

berenddeboer’s picture

@buddyfinton, I stumbled upon this issue searching for an answer to a similar problem I had. In the end there were two things wrong: site had the Page Title module and the Entity Path module enabled. After disabling both, as site wasn't using them, everything worked perfectly.

il.muraviov’s picture

I use Views to display taxonomy, but have the same problem with Metatag. Anyone know how to resolve the problem? As I understand the only way nowadays is to disable Views for taxonomy?

DamienMcKenna’s picture

Title: Cannot get title to work on views taxonomy/term page » Cannot get page title to work on Views pages
DamienMcKenna’s picture

Two things to test - use drupal_set_title(), or use template_preprocess_html().

johnpicozzi’s picture

@damienMcKenna - Could this be a problem in D8? I am having a very similar problem where we use a token replacement for the title {{ title }} and it gets replaced correctly on the Drupal Views Preview output. However, on the views page in the tag (browser tab) you see {{ title }} | Site name.

DamienMcKenna’s picture

@johnpicozzi: I have zero clue about that, sorry.

johnpicozzi’s picture

@DamienMcKenna - Looks like Metatag module is not replacing the {{ title }} in the html title tag with the correct value. We have tested D8 with and without Metatag. Without Metatag the title (contextual filter replacement) displays correctly, with Metatag it does not.

Should we open a new issue or convert this one to a D8 Issue? Also, any solutions on the horizon?

DamienMcKenna’s picture

Metatag doesn't do Twig string replacement, it only uses regular tokens.

OMD’s picture

Am I missing something or is there no way to get useful fields like "Content:Title" into the page title using the views meta tags settings?