Menu - Link Title Attribute - Doesn't Work

Rate this topic: Evaluations: 1, 1.00 on the average.Evaluations: 1, 1.00 on the average.Evaluations: 1, 1.00 on the average.Evaluations: 1, 1.00 on the average.Evaluations: 1, 1.00 on the average.Evaluations: 1, 1.00 on the average.1.00 out of 6 based on 1 vote(s)
GK User
Fri May 10, 2013 12:45 am
Reply with quote
Report this post
Hello

I've installed on localhost the newest version of joomla (3.1.1 i think it is) along with the newest version of gk_news template (first installed quickstart then updated joomla).

I've been trying to add custom title attribute to the main menu links but they do not show up, the title attribute remains the anchor text of the link.

Is it a bug? How can I fix this?

Thank you
User avatar
Fresh Boarder

GK User
Fri May 10, 2013 2:52 am
Reply with quote
Report this post
After searching through the different php files I figured out what's wrong and fixed it.

The problem was that you never implemented the ability to have a custom menu link title attribute so I implemented it myself.

If any1 else wants to know how, here it goes :

Go to file ../templates/gk_news/lib/menu/GKBase.class.php

at line 345 you'll find $title = "title=\"$tmpname\"";

Replace that with

if ( $tmp->params->get('menu-anchor_title') ) {
$tmp->anchor_title = htmlspecialchars($tmp->params->get('menu-anchor_title', ''), ENT_COMPAT, 'UTF-8', false);
$title = $tmp->anchor_title ? 'title="'.$tmp->anchor_title.'" ' : '';}
else { $title = "title=\"$tmpname\""; }

and you're set

Now, if you believe that having the menu anchor text as the link title is stupid and annoying to the user ( I do), then from the above code you can ommit the else { $title = "title=\"$tmpname\""; } part



And to the gavick team, please update the template with the above code, and ideally add a choice in the backend to ommit the link title attribute if there is no custom one present, so that I, and any1 else who proceeds with the above hacks, won't have to reapply the hack at every update.

Thank you
User avatar
Fresh Boarder

teitbite
Fri May 10, 2013 4:51 pm
Reply with quote
Report this post
Hi

Thank You for that. I'll show this to developers, but cannot promise that this will be included soon. I believe such functionality was provided by some additional plugin.
User avatar
Moderator


cron