Restricting the catalogue

We have set up a product catalogue, but now want to restrict it, for instance to make a catalogue of one category of products. Let us modify the catalogue we've just set. Alternatively, you can use a clone of it (In order to clone the catalogue, go to Structure → View; in the column "Operations" and the row of the view we've created, click on the small arrow and then on "Clone"). We just add yet a new filter criteria in the view, clicking on the "Add" button at the right of "Filter criteria".

Add the nodes taxonomy term names from a chosen vocabulary as css-class to every menu item

This code can be used to to add the nodes taxonomy term names from a chosen vocabulary as css-class to every menu item. This can be used to hide certain menu items with css/javascript depending on which terms a node with menu entry is assigned to.

Put this code in template.php<?php
function YourThemeName_menu_item_link($link) {
if (empty($link['localized_options'])) {
$link['localized_options'] = array();
if (preg_match('/^node/',$link['href'])) {
//get node id
$nid = explode("/", $link['href']);
$nid = $nid[1];

$node = node_load($nid); // cached
$desired_vocab = 2; // only print terms in this vocab
// print '

'. $nid. check_plain(print_r($node, 1)) .'


// if the term does not exist we're done
if (is_array($node->taxonomy)) {
foreach ($node->taxonomy as $term) {
if ($term->vid == $desired_vocab) {
$taxonomy_class = strtolower($term->name);
if (empty($link['localized_options']['attributes']['class'])) {
$link['localized_options']['attributes']['class'] = $taxonomy_class .' menu-'. $link['mlid'];

else {
$link['localized_options']['attributes']['class'] .= $taxonomy_class .' menu-'. $link['mlid'];
//print '

'. check_plain(print_r($link, 1)) .'


Taxonomy menu: navigation for terms

Taxonomy terms allow classification of content into categories and subcategories. The Taxonomy Menu module adds links to the navigation menu for taxonomy terms. This is useful when the community is focused on creating content that is organized in a taxonomy.

Creating a Taxonomy Menu

In order to create a taxonomy menu, first create your vocabulary. If you have an existing vocabulary, navigate to the taxonomy administration menu. The path depends on your Drupal version (5, 6, or 7).

Subscribe with RSS Subscribe to RSS - vocabulary