Class ::xowiki::includelet::decoration=portlet

::xowiki::includelet::decoration=portlet[i] create ...

Class Relations

  • class: ::xotcl::Class[i]
  • superclass: ::xotcl::Object[i]
::xotcl::Class create ::xowiki::includelet::decoration=portlet \
     -superclass ::xotcl::Object

Methods (to be applied on instances)

  • render (scripted)

    set name       ${:name}
    set title      ${:title}
    set package_id ${:package_id}
    set class      [namespace tail [:info class]]
    set id         [expr {[info exists :id] ? "id='[:id]'" : ""}]
    set html       [next]
    set localized_title [ns_quotehtml [::xo::localize $title]]
    set href [::$package_id pretty_link -parent_id [::$package_id folder_id] $name]
    set link [expr {[string match "*:*" $name]
                    ? "<a href='[ns_quotehtml $href]'>$localized_title</a>"
                    : $localized_title}]
    ::xo::render_localizer
    
    set card_class [template::CSS class card]
    set card_header_class [template::CSS class card-header]
    set card_body_class [template::CSS class card-body]
    
    if {$link ne ""} {
       set template {
          <div class="$card_class">
            <div class="$card_header_class">$link</div>
            <div class="$card_body_class">$html</div>
          </div>
       }
    } else {
       set template {
          <div class="$card_class">
            <div class="$card_body_class">$html</div>
          </div>
       }
    }
    return [subst [ns_trim -delimiter | {
      |<div class='$class'>
      |  <div class='portlet-wrapper'>
      |    [subst $template]
      |  </div>
      |</div>}]]