xotcl.wu-wien.ac.at
Begin main content
Search · Index
No registered users in community s5-xowiki-tutorial
in last 10 minutes

Custom Includelet

# Define a custom includelet which receives as input location coordinates
# (longitude and latitude) according to the WGS84 specification
# and renders it in micro-format mark-up
::xowiki::IncludeletClass create geo \
   -superclass ::xowiki::Includelet \
   -parameter {
      {__decoration plain}
      {parameter_declaration {
        {-longitude}
        {-latitude}
      }}
   }

# Provide a custom renderer for the microformat output
# (following http://microformats.org/wiki/geo}
geo instproc render {} {
   my get_parameters
   return [subst {
     <div class="geo">Coordinates:
     <span class="latitude">$latitude</span>
     <span class="longitude">$longitude</span>
     </div>
   }]
}