Closed (won't fix)
Project:
Nodewords: D6 Meta Tags
Version:
5.x-1.12
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
27 Oct 2008 at 14:09 UTC
Updated:
2 Jul 2009 at 16:14 UTC
I find out that metatags doesn't show on Ubercart catalog pages (they have path like "catalog/$tid") so I modify the function _nodewords_detect_type_and_ids() and some extra "case"
switch (arg(0)) {
case 'node':
// Node paths: node/$nid
if (is_numeric(arg(1))) {
return array('type' => 'node', 'ids' => arg(1));
}
break;
case 'user':
// User paths translated into nodes: user/$uid -> node/$bio_nid
if (is_numeric(arg(1)) && module_exists('bio') && variable_get('bio_profile_takeover', 0)) {
if (($bio_nid = bio_for_user(arg(1)))) {
return array('type' => 'node', 'ids' => $bio_nid);
}
}
break;
case 'taxonomy':
// Taxonomy paths: term/$tid , term/$tid1+$tid2 , vocabulary/$vid
if (arg(1) == 'term' || arg(1) == 'vocabulary') {
$ids = preg_split('![+, ]!', arg(2));
if (count($ids)) {
return array('type' => arg(1), 'ids' => $ids);
}
}
break;
case 'catalog':
// Catalog paths: catalog/$tid [+] by Eugef !!!!!! <------------
if (is_numeric(arg(1))) {
return array('type' => 'term', 'ids' => arg(1));
}
break;
case 'forum':
// Forum paths: forum/$tid , forum/
if (is_numeric(arg(1))) {
return array('type' => 'term', 'ids' => arg(1));
}
elseif (is_null(arg(1))) {
return array('type' => 'vocabulary', 'ids' => variable_get('forum_nav_vocabulary', 0));
}
break;
case 'image':
// Image gallery paths: image/ , image/???/$tid
if (is_null(arg(1))) {
return array('type' => 'vocabulary', 'ids' => variable_get('image_gallery_nav_vocabulary', 0));
}
else if (is_numeric(arg(2))) {
return array('type' => 'term', 'ids' => arg(2));
}
break;
case 'taxonomy_menu':
// Taxonomy menu paths: taxonomy_menu/$vid, taxonomy_menu/$vid/$tid
if (!is_null(arg(2)) && is_numeric(arg(2))) {
return array('type' => 'term', 'ids' => arg(2));
}
else if (is_numeric(arg(1))) {
return array('type' => 'vocabulary', 'ids' => arg(1));
}
break;
}
This code works great for me!
Comments
Comment #1
Eugene Fidelin commentedOne more code version
Comment #2
himagarwal commentedgreat work, i was searching for the same thing. is there a way this code can be added to template.php file, since changing the core module will make it hard for upgrade process.....
Comment #3
asak commentedworks great!
Comment #4
wflorian commentedI would be also interested in this...
Comment #5
avpadernoAs the Drupal 5 version is not supported anymore, I am changing the status of this report.