Re: HTML_TreeMenu tooltip

From: Date: Wed, 04 May 2005 21:21:24 +0000
Subject: Re: HTML_TreeMenu tooltip
References: 1  Groups: php.pear.general 
Request: Send a blank email to pear-general+get-19073@lists.php.net to get a copy of this message
Hi Vincent, >----- Original Message ----- >From: "Vincent DUPONT" <Vincent.dupont@ausy.be> >To: <pear-general@lists.php.net> >Sent: Wednesday, April 27, 2005 12:08 PM >Subject: [PEAR] HTML_TreeMenu tooltip > >Hello, > >I use the HTML_TreeMenu, and would like to add a tooltip on the menu >items by adding a alt or title attribute. Is this possible? Yes, it is. In your DirectTreeRenderer.php look for (but make a backup first): var $_entryTemplates = array( HTML_MENU_ENTRY_INACTIVE => '<a class="{class}" title="{description}" href="{url}{anchor}" target="{target}">{title}</a>', HTML_MENU_ENTRY_ACTIVE => '<a class="a{class}" title="{description}" href="{url}{anchor}" target="{target}">{title}</a>', HTML_MENU_ENTRY_ACTIVEPATH => '<a class="p{class}" title="{description}" href="{url}{anchor}" target="{target}">{title}</a>' ); As you can see, i added some 'template names' (i do not know which of them have been already there). I think you get the idea. In your file where you maintain your menu structure you then put: // ----- $data = array( 'XYZ' => array( "class" => "cssname", "description" => "Tooltip of the day", "url" = "/", "anchor" => "", "target" => "", "title" => "Linkname" ), ); // ------ This way you are able to customize your menu using css, give descriptions using the title tag in <a ... title="">, set anchors etc. >vincent HTH, Marcus

« previous php.pear.general (#19073) next »