title-element in menues

Everything to do with Joomla! 1.5 templates and templating.

Moderator: General Support Moderators

Forum rules
Forum Rules
Absolute Beginner's Guide to Joomla! <-- please read before posting, this means YOU.
Locked
User avatar
marvin06
Joomla! Apprentice
Joomla! Apprentice
Posts: 39
Joined: Mon Feb 11, 2008 8:30 am
Location: Wien
Contact:

title-element in menues

Post by marvin06 » Thu Dec 04, 2008 8:33 am

hi,

i am writing a accessible template. now everything is fine with joomla - with version 1.5 its much easier to create accessible website than ver. 1.0.

also the menue works fine and its possible to generate a list-menue. the problem I have is that I want to integrate the title-element in the menue-links. is there any possibility to do this?

thanks, marvin
emergency exit >>

User avatar
simonlogan
Joomla! Explorer
Joomla! Explorer
Posts: 281
Joined: Fri Jul 25, 2008 4:09 pm

Re: title-element in menues

Post by simonlogan » Fri Dec 05, 2008 5:16 pm

You could probably do this using a template override for the menu. Just open up the mod_mainmenu code (assuming this is what you're using for your menu), save it to your template folder in the correct place (template/html/modules/mod_mainmenu) and look for the bit where you'd want the title tag to go. You'll need to find out the name of the variable for the tag to take its value from but this will presumably be the same as the text for the link so just copy the code for that and insert it into the title"titlecodehere" bit you have added in.

Hope that helps.
Simon Logan -
Principal Web Designer, Arcas Computing Ltd.

http://www.arcas.co.uk

User avatar
marvin06
Joomla! Apprentice
Joomla! Apprentice
Posts: 39
Joined: Mon Feb 11, 2008 8:30 am
Location: Wien
Contact:

Re: title-element in menues

Post by marvin06 » Fri Dec 05, 2008 6:27 pm

thanks for the input ...this is the way I tried to solve my little problem. Unfortunately I wasnt able to find the correct place.

are there any free templates in which this solution is used?

bye marvin
emergency exit >>

User avatar
simonlogan
Joomla! Explorer
Joomla! Explorer
Posts: 281
Joined: Fri Jul 25, 2008 4:09 pm

Re: title-element in menues

Post by simonlogan » Fri Dec 05, 2008 8:20 pm

Hi Marvin

Had another look and the menu is built in modules/mod_mainmenu/helper.php so is not overridable but if you get into that file and look for line 342:

Code: Select all

$data = '<a href="'.$tmp->url.'">'.$image.$tmp->name.'</a>';
and change it to this :

Code: Select all

$data = '<a href="'.$tmp->url.'" title="">'.$image.$tmp->name.'</a>';
You'll notice that I didn't add anything into the quote marks to hold the title, this is because I ran out of time trying to figure out what variable should go in there! I tried a few but they either didn't work or it broke the menu :) But if you put some text in there instead to begin with ie "mytitle" then refresh your page and check the code, you should see that showing up and at least it shows you you're editing the right thing.

There could be other adjustments you need to make depending upon the type of menu you're using etc but this worked for me, at least in as far as it let me edit the bit that needed editing.

Hope this helps, will be back at my machine on Monday so if you haven't cracked it by then I'll give you another hand as it will be handy for me to know too - like you say, great for accessibility.
Simon Logan -
Principal Web Designer, Arcas Computing Ltd.

http://www.arcas.co.uk

User avatar
marvin06
Joomla! Apprentice
Joomla! Apprentice
Posts: 39
Joined: Mon Feb 11, 2008 8:30 am
Location: Wien
Contact:

Re: title-element in menues

Post by marvin06 » Fri Dec 05, 2008 9:32 pm

hi simon,

you were right - I refered to the mainmenu module. thank you for the proposal. Unfortunately it is not possible to overwrite the helper.php by the template. So I ended up doing modifications in the core-helper.php of mod_mainmenu. At line 343:

Code: Select all

$data = '<a href="'.$tmp->url.'" title="'.$tmp->url.'">'.$image.$tmp->name.'</a>';
At line 347:

Code: Select all

$data = '<a href="'.$tmp->url.'" title="'.$tmp->url.'" target="_blank">'.$image.$tmp->name.'</a>';
a.s.o.
With this variable the menu returns the URL in the title element, which is not nice, but ok (if youre working with SEF URLs).

Title elements in the mainmenu should be a must - and should be supported by default. I'll put that issue up in the joomla!-wishlist, tracker - whatever;) Even within the beez-template which claims accessibility these elements are missing.

Any other ideas? bye, marvin

PS: But I already saw the next "title-ghost" in my template: the element is missing @ the readon-links in content-items:( but now its to late, 10.30pm
emergency exit >>

User avatar
marvin06
Joomla! Apprentice
Joomla! Apprentice
Posts: 39
Joined: Mon Feb 11, 2008 8:30 am
Location: Wien
Contact:

Re: title-element in menues

Post by marvin06 » Tue Dec 09, 2008 12:29 pm

Hi,

I`m back with more information concerning the missing title tags in system and template files, following some references to the necessary additonal code:
default_item.php (let the standard default_item.php override by the template file), line 14, for the missing item title:

Code: Select all

<a href="<?php echo $this->item->readmore_link; ?>" title="<?php echo $this->item->title; ?>" class="contentpagetitle<?php echo $this->item->params->get('pageclass_sfx'); ?>">
default_item.php (let the standard default_item.php override by the template file), line 110, for the missing readmore title:

Code: Select all

<a href="<?php echo $this->item->readmore_link; ?>" title="Read the full article: <?php echo $this->item->title; ?>" class="readon<?php echo $this->item->params->get('pageclass_sfx'); ?>">
Alike changes have to be done in the other content-template files (e.g. folder category --> blog_item.php) as well as mod_latestnews, mod_mostread, a.s.o.
bye, marvin
emergency exit >>

User avatar
marvin06
Joomla! Apprentice
Joomla! Apprentice
Posts: 39
Joined: Mon Feb 11, 2008 8:30 am
Location: Wien
Contact:

Re: title-element in menues

Post by marvin06 » Sun Jun 28, 2009 6:42 pm

See http://www.gn-webdesign.de/joomla-tutor ... ribut.html (resp http://www.w3studio.nl/joomla-sites/downloads.html) for a better (databased) solution.

Hopefully this, or any similar update comes with Ver 1.6. Title Attributes for the mod_mainmenu elements are absolutely necessary.
emergency exit >>


Locked

Return to “Templates for Joomla! 1.5”