Hi,

I am using the below stated code to display the terms associated with the page.Is there any way to show it in ascendng and descending order alphabetically.

/**
 * Prints an unordered list of the terms (as links) that are
 * associated to the currently displayed node.

if ( arg(0) == 'node' && is_numeric(arg(1)) ) {
    $node = node_load(arg(1));
    $vid = 2;
    $terms = taxonomy_node_get_terms_by_vocabulary($node, $vid);
    if ($terms) {
print '<ul>';
                foreach ($terms as $term) {
                print '<li>'.l($term->name, 'taxonomy/term/'.$term->tid).'</li>';

          }
print '</ul>';
    } 
}

**/

Current Result:
Mango
Apple
Orange
Bananna

Required Result:
Apple
Bannana
Mango
Orange

Comments

marcoka’s picture

Status: Needs work » Closed (won't fix)

this module, as you can read on the module page is OBSOLETE and not developed anymore.