Class ::xowiki::TreeRenderer=bootstrap3horizontal

::xowiki::TreeRenderer=bootstrap3horizontal[i] create ...

Class Relations

  • class: ::xowiki::TreeRenderer[i]
  • superclass: ::xowiki::TreeRenderer=list[i]
::xowiki::TreeRenderer create ::xowiki::TreeRenderer=bootstrap3horizontal \
     -superclass ::xowiki::TreeRenderer=list

Methods (to be applied on the object)

  • render (scripted)

    set name [$tree name]
    if {$name ne ""} {
      set navbarLabel [subst {
        <div class="navbar-header">
        <a class="navbar-brand" href="#">[ns_quotehtml $name]</a>
        </div>
      }]
    } else {
      set navbarLabel ""
    }
    
    return [subst {
      <nav class="navbar navbar-inverse">
      <div class="container-fluid">[ns_quotehtml $navbarLabel]
      <ul class="nav navbar-nav">
      [next]
      </ul>
      </div>
      </nav>
    }]

Methods (to be applied on instances)

  • render_node (scripted)

    set label [::xowiki::Includelet html_encode ${:label}]
    
    if {${:level} == 0} {
      #
      # Top level entry: build menu-button and wrapper for dropdown menu
      #
      append entry  "<a class='dropdown-toggle' data-toggle='dropdown' href='#'>"  [ns_quotehtml $label]  "</a>"
      set o_atts "class='dropdown'"
      set u_atts "class='dropdown-menu'"
    
    } else {
      #
      # Lower level entry: build dropdown menu entries
      #
      # Probably, entries on a deeper level than 1 should be ignored
      # or differently handled.
      #
      append entry  "<a href='[ns_quotehtml ${:href}]'>"  [ns_quotehtml $label]  </a>
      set o_atts ""
      set u_atts ""
    }
    if {$cat_content ne ""} {
      set content "\n<ul $u_atts>\n$cat_content</ul>"
    } else {
      set content ""
    }
    return "<li $o_atts>$entry $content"