Hi all, I have a bug upgrading from 6.x-2.3 to 6.x-2.4 on Drupal 622.
I update the module in the correct way. I flush all cache.
Now [cat-description] | [site-name] in /admin/settings/page-title don't work (see the attachment).
I don't understand. Any ideas? Many thanks.
b

(Any way the field Page title of the single Taxonomy in -- Administer › Content management › Taxonomy › Edit term -- don't work. For this reason i use cat-description) (see the attachment)

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

nicholasThompson’s picture

Can you clarify "Don't work" please?

Your two screenshots shot different things. The first is a PATTERN (or a Page Title template for terms in that vocabulary). The other is a PAGE TITLE which overrides the TERM NAME.

For example, you might have a Term called "FAQ"... but you might want the Term Name to be Frequently Asked Questions when [cat-name] is used in the pattern for the vocab on on the taxonomy/term/123 URL.

I have tested my local dev and it seems ok.

bardill’s picture

Hi Nicholas, many thanks.
In 6.x-2.3 i have set only [cat-description] | [site-name] - the pattern. And it was ok.
Now (6.x-2.4) the taxonomy description don't overrides the TERM NAME!

(to solve i try to delete [cat-description] | [site-name] in /admin/settings/page-title and i try to set PAGE TITLE which overrides the TERM NAME. But also here i still see only the term name).

nicholasThompson’s picture

Are these taxonomy pages controlled by Views?

bardill’s picture

Yes, they are controlled by Views.
But with 6.x-2.3 there is not problem.

Many thanks.
b

nicholasThompson’s picture

2.3 didn't support Views. 2.4 Does and Views runs after Taxonomy.

This means taxonomy/term/123 is provided by views and Views will try to take over the Page Title pattern.

Are you using a normal "Page" display for the View?

"Now (6.x-2.4) the taxonomy description don't overrides the TERM NAME!"

Why would Term Description EVER override the Term Name?!

bardill’s picture

Sorry Nicholas!
i have 4 taxonomy term in my vocabulary and a views that print contents splitting in taxonomy.
The path of page views is taxonomy/term/%.
In attachment my setting that works with 2.3.
With 2.4 all works except ---global taxonomy--- last field (see the attachment)
I only updated your module - no others.
I really no understand the problem.

nicholasThompson’s picture

and by "doesn't work", do you mean one of the tokens isn't being replaced? Or are they being replaced with incorrect data?

What are you expecting the Page Title to be, and what are you getting instead?

bardill’s picture

The token [cat-description] don't replace the name of the taxonomy (that is the default title of the page).
The result is: real default name of the taxonomy | [site-name]

With 2.3 your module write --- taxonomy description | [site-name] --- and it was ok.
With the 2.4 [cat-description] is as if there were not!

(The token [site-name] work well also in 2.4)
I reply - I really no understand the problem.

Many thanks.
b

bardill’s picture

Hi Nicholas! Also with 2.5 I have the same problem.
(The 2.3 it's ok).

b

nicholasThompson’s picture

Title: [cat-description] | [site-name] in /admin/settings/page-title don't work » Taxonomy Term View overrides the Vocabulary Pattern settings.
Version: 6.x-2.4 » 6.x-2.5
Status: Active » Needs work

The problem is, I believe, that your taxonomy/term/% page is controlled by Views. Because of this, the Taxonomy module no longer recognises/registers this as a Taxonomy page... see:
http://drupalcode.org/project/page_title.git/blob/a9a5d31d9357fa13603b3c...

...
  if ( !strncmp($menu_item['path'], 'taxonomy/term/%', 15) &&
       ($term = taxonomy_get_term($menu_item['page_arguments'][0])) ) {
...

In that snippet, the first clause will match (the menu item path will, in all likeliness be that - but I'd need to check), however the later may not match as the menu item argument zero is probably a view display name.

This is my guess at the moment; I will need to investigate.

I would imagine that if you disable the taxonomy_term View then the PageTitle will work (I understand this isn't a "fix" though!).

If you are using Views, you can replace the Page Display in the View with a "Page with Page Title" display which exposes some data to views. You can use Global tokens (such as [site-name]), however contextual tokens do not work yet (it involved building a whitelist, matching argument handlers to contexts). In the argument you should see a Page Title field if you override it on the Page With Page Title display, in the argument you can use "%1" as a placeholder which will replace with the Term Name.

bardill’s picture

Hi Nicholas, many thanks.
For now i use 2.3 (that works). I wait very interested the 2.6!

u210ks’s picture

subscribing

quip’s picture

subscribing

Lostmonkey’s picture

subscribing

Kohnock’s picture

subscribing

sovarn’s picture

subscribe

daggerhart’s picture

Quick fix for taxonomy pages with views override:

Add this function to your theme's template.php file

function MYTHEME_preprocess_page(&$vars){
  // make sure this is a taxonomy term page
  if(arg(0) == 'taxonomy' && arg(1) == 'term' && is_numeric(arg(2))){
    // look for legit page title and use it if found
    if($page_title = page_title_load_title(arg(2), 'term')){
      $vars['head_title'] = $page_title;
    }
  }
}

edit: slight modification to code

planctus’s picture

I have this problem too...
I've read all the posts here but i really don't understand what's the point.
In my situation i've the taxonomy term view with a normal page display and i guess it has always been the same since i started using this module.
The page title falls back to the default one and this might mean that the page is not recognized as a term page by the module? But why should this happen now, with this particular module version?

Anyway, i tried to fix this using the snippet above but then i realized that there were no data in the db in the page title table so page_title_load_title(arg(2), 'term') won't return anything...

I've also tried to use the page title display but it didn't change anything...
I'm pretty blocked about this.
Thanks,
Da.

tiflopin’s picture

I have the same problem too too :-)

When I change the Vocabulary pattern in the page-title setting page, it has no effect on the title,
it keep the default pattern.

Florent (French so sorry for my English !)

fatfish’s picture

Need to patch taxonomy.page-title.inc

/**
 * Implementation of hook_page_title_alter().
 */
function taxonomy_page_title_alter(&$title) {
  $menu_item = menu_get_item();
  // If we're looking at a taxonomy term page, get the term title
  if ( !strncmp($menu_item['path'], 'taxonomy/term/%', 15) &&
---        ($term = taxonomy_get_term($menu_item['page_arguments'][0])) &&
+++   ($term = taxonomy_get_term($menu_item['page_arguments'][2])) &&
       variable_get('page_title_vocab_'. $term->vid .'_showfield', 0) &&
       ($term_title = page_title_load_title($term->tid, 'term')) ) {
    $title = $term_title;
  }
}


/**
 * Implementation of hook_page_title_pattern_alter().
 */
function taxonomy_page_title_pattern_alter(&$pattern, &$types) {
  $menu_item = menu_get_item();

  // Taxonomy Term Page
  if ( !strncmp($menu_item['path'], 'taxonomy/term/%', 15) &&
---       ($term = taxonomy_get_term($menu_item['page_arguments'][2])) ) {
+++  ($term = taxonomy_get_term($menu_item['page_arguments'][2])) ) {
    $types['taxonomy'] = $term; 
    $pattern = variable_get('page_title_vocab_'. $types['taxonomy']->vid, '');
  }
}
nicholasThompson’s picture

Fatfish - unfortunately, this wont work. That fixes it for use with Views as Views will see it as page argument 2 - but Core taxonomy see's the Term ID are arg(0)...

I'm looking into this... Annoyingly, core defines taxonomy/term/% rather than using a menu loader (which D7 does). This means we can't use menu_get_object().

nicholasThompson’s picture

Status: Needs work » Fixed

I've pushed a fix for this into DEV. Switched from using page_arguments to map on the $menu_item. Should improve matters..

Bartezz’s picture

Updating to .dev solved this issue for me! Thanx!

Cheers

Lostmonkey’s picture

I seem to be having the same issue using 7.x-2.5, is this also fixed in the next version?

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

bardill’s picture

Sorry, this problem is solve.

Many thanks.
b