Skip to main content
set $ var prefix
Source Link
Shawn Conn
  • 26.9k
  • 15
  • 49
  • 73

You can override the display your theme node.tpl.php template. Place something like this in your template.php...

function MYTHEME_preprocess_node(&$variables) {
   $variables['price_display'] = '';
   if(isset($variables['node']->field_terms[LANGUAGE_NONE]) && is_array(($variables['node']->field_terms[LANGUAGE_NONE]))) {
     foreach($variables['node']->field_terms[LANGUAGE_NONE] as $tag) {
        if(isset($tag['taxonomy_term']) && tag['taxonomy_term']$tag['taxonomy_term']->name == 'price') {
          $variables['price_display'] = 'see website';
          break;
        }
      }
    }
  }
}

At this point you should have the variable $price_display available to print out in node.tpl.php.

You can override the display your theme node.tpl.php template. Place something like this in your template.php...

function MYTHEME_preprocess_node(&$variables) {
   $variables['price_display'] = '';
   if(isset($variables['node']->field_terms[LANGUAGE_NONE]) && is_array(($variables['node']->field_terms[LANGUAGE_NONE]))) {
     foreach($variables['node']->field_terms[LANGUAGE_NONE] as $tag) {
        if(isset($tag['taxonomy_term']) && tag['taxonomy_term']->name == 'price') {
          $variables['price_display'] = 'see website';
          break;
        }
      }
    }
  }
}

At this point you should have the variable $price_display available to print out in node.tpl.php.

You can override the display your theme node.tpl.php template. Place something like this in your template.php...

function MYTHEME_preprocess_node(&$variables) {
   $variables['price_display'] = '';
   if(isset($variables['node']->field_terms[LANGUAGE_NONE]) && is_array(($variables['node']->field_terms[LANGUAGE_NONE]))) {
     foreach($variables['node']->field_terms[LANGUAGE_NONE] as $tag) {
        if(isset($tag['taxonomy_term']) && $tag['taxonomy_term']->name == 'price') {
          $variables['price_display'] = 'see website';
          break;
        }
      }
    }
  }
}

At this point you should have the variable $price_display available to print out in node.tpl.php.

Source Link
Shawn Conn
  • 26.9k
  • 15
  • 49
  • 73

You can override the display your theme node.tpl.php template. Place something like this in your template.php...

function MYTHEME_preprocess_node(&$variables) {
   $variables['price_display'] = '';
   if(isset($variables['node']->field_terms[LANGUAGE_NONE]) && is_array(($variables['node']->field_terms[LANGUAGE_NONE]))) {
     foreach($variables['node']->field_terms[LANGUAGE_NONE] as $tag) {
        if(isset($tag['taxonomy_term']) && tag['taxonomy_term']->name == 'price') {
          $variables['price_display'] = 'see website';
          break;
        }
      }
    }
  }
}

At this point you should have the variable $price_display available to print out in node.tpl.php.