I used to have my own theme implementation of page title for Ubercart product pages, but have ditched that in favour of the native support. However, it seems to be broken. The "scopes" setting defines global and taxonomy, but there doesnt seem to be any taxonomy tags.

I used to use "term:" tags, surely the scope should be the same as the taxonomy pages, or at least be global and terms?

Other than the global tokens, there are no other available tokens to use on the Ubercart catalog field. As "taxonomy" doesnt appear to relate to anything.

Comments

alexp999’s picture

I've managed to fix this myself:

OPEN:
modules/uc_catalog.page_title.inc

FIND:

    $types['taxonomy'] = $term;
    $pattern = variable_get('page_title_uc_catalog_' . $types['taxonomy']->vid, '');

REPLACE WITH:

    $types['term'] = $term;
    $pattern = variable_get('page_title_uc_catalog_' . $types['term']->vid, '');

FIND:
'scopes' => array('global', 'taxonomy'),

REPLACE WITH:
'scopes' => array('global', 'term'),

nicholasThompson’s picture

Version: 7.x-2.7 » 7.x-2.x-dev
Status: Active » Needs review

Patch:


diff --git a/modules/uc_catalog.page_title.inc b/modules/uc_catalog.page_title.inc
index 3bd9910..2562c6e 100644
--- a/modules/uc_catalog.page_title.inc
+++ b/modules/uc_catalog.page_title.inc
@@ -41,8 +41,8 @@ function uc_catalog_page_title_pattern_alter(&$pattern, &$types) {
   if ( !strncmp($menu_item['path'], 'catalog', 7) &&
        isset($menu_item['page_arguments'][0]) &&
        ($term = taxonomy_term_load($menu_item['page_arguments'][0])) ) {
-    $types['taxonomy'] = $term;
-    $pattern = variable_get('page_title_uc_catalog_' . $types['taxonomy']->vid, '');
+    $types['term'] = $term;
+    $pattern = variable_get('page_title_uc_catalog_' . $types['term']->vid, '');
   }
 }

@@ -58,7 +58,7 @@ function uc_catalog_page_title_settings() {
     $settings['page_title_uc_catalog_' . $vocab->vid] = array(
       'label' => 'Ubercart Catalog - %vocab_name',
       'label arguments' => array('%vocab_name' => $vocab->name),
-      'scopes' => array('global', 'taxonomy'),
+      'scopes' => array('global', 'term'),
       'show field' => FALSE,
       'description' => 'This pattern will be used for all %vocab_name Ubercart catalog pages.<br />' .
                        'The Show Field setting does not apply here. Use the matching Vocabulary row.',

I have committed this into the dev branch - it'll be in the next release. I'd appreciate you checking that the dev branch patch is consistent with your fix and works as expected :)

alexp999’s picture

Works as expected, thanks :)