[Date Index][Thread Index]
[Date Prev][Date Next][Thread Prev][Thread Next]

Re: wishlist: text in rollover,navbar buttons and class for anchortags



On Fri, 2 Jun 2000, F. Heinrichmeyer wrote:

> Hello,
> 
> is there a navbar filter function example available?

Here is one.
Without <navbar:filter> this navbar is composed of 4 images.
HTML code is modified to emulate your image+text feature.  This is a
very simple example, it needs some work to produce what you want.

  #use wml::des::navbar
  
  <navbar:define name=test>
    <navbar:button id=b1 url="b1.html" img=star-*.gif txt="First">
    <navbar:button id=b2 url="b2.html" img=star-*.gif txt="Second">
    <navbar:button id=b3 url="b3.html" img=star-*.gif txt="Third">
    <navbar:button id=b4 url="b4.html" img=star-*.gif txt="Fourth">
    <navbar:filter>
      my ($code, $CFG, $select) = @_;
      #   $code is the generated HTML text
      #   $CFG is an internal hash array containing all informations
      #        on buttons (you surely do not need it)
      #   $select is set by user in <navbar:render> (`b3' below)
  
      $code =~ s|(<img .*? alt="(.*?)".*?>)|$1 $2|sg;
  
      #   Returns the string which will be printed
      return $code;
    </navbar:filter>
  </navbar:define>
  
  <navbar:render name=test select=b3>

-- 
Denis Barbier
WML Maintainer

______________________________________________________________________
Website META Language (WML)                www.engelschall.com/sw/wml/
Official Support Mailing List                   sw-wml@engelschall.com
Automated List Manager                       majordomo@engelschall.com