For Programmers: Free Programming Magazines  


Home > Archive > PHP Pear > May 2005 > Re: [PEAR] HTML_TreeMenu tooltip









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Re: [PEAR] HTML_TreeMenu tooltip
Marcus Merz

2005-05-04, 8:57 pm

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
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com