Download & Extend

Incorrect HTML structure for nested lists

Project:Taxonomy Block
Version:6.x-1.0-beta2
Component:Code
Category:bug report
Priority:minor
Assigned:Unassigned
Status:closed (fixed)
Issue tags:markup, nesting, structure

Issue Summary

The UL/LI structure is not correct according to the HTML standard; nested ULs for child terms are directly in the parent UL of a taxonomy term. Instead, they should be inside the LI item that corresponds to the terms' parent.

Attached is a trivial patch that fixes this.

AttachmentSize
taxonomy_block.html-nesting-fix.patch786 bytes

Comments

#1

Status:active» closed (fixed)

Nothing wrong with the code:

        $output .= '<li>';
        if (module_exists("i18n")) {
          $output .= l(tt("taxonomy:term:$tid_parent:name", $name_parent), "taxonomy/term/$tid_parent");
        } else {
          $output .= l(t($name_parent), "taxonomy/term/$tid_parent"); 
        }
        if ($node_count) {
          $total_parent = db_result(db_query("SELECT COUNT(nid) FROM {term_node} WHERE tid = %d", $tid_parent));
          $output .= " ($total_parent)";
        }
        $output .= "</li>";   // This line needed to close the first <li> tag