WebsiteBaker Community Forum

WebsiteBaker Support (2.8.x) => Templates, Menus & Design => Topic started by: myownalias on April 03, 2009, 08:56:32 PM

Title: Adding title="LINKNAME" to generated menu links.
Post by: myownalias on April 03, 2009, 08:56:32 PM
Hello fellow WB'ers,

I found this wonderfully simple CMS a few weeks back and now I am implementing WB into a friends websiite. I want to be able to add title="LINKNAME" to links generated by WB. I assume that it's in one of the modules somewhere but can't find it by searching the content of the files. Any help on how to implement this would be greatly appreciated.

Jason.
Title: Re: Adding title="LINKNAME" to generated menu links.
Post by: Stefek on April 03, 2009, 11:03:56 PM
Do you want to have the title attribute in the menu or in general links (in the content)?

For the content it's pretty simple. Just use the link button in the FCK Editor and go to the "advanced tab".

Regards,
Stefek
Title: Re: Adding title="LINKNAME" to generated menu links.
Post by: myownalias on April 05, 2009, 03:29:00 AM
Thanks for the reply Stefek,

I want to be able to add the title directly to the menu links generated by WB.

Jason.
Title: Re: Adding title="LINKNAME" to generated menu links.
Post by: mviens on June 08, 2009, 09:56:31 PM
Hi Jason,

If you are using showmenu_2 to generate your menus (default in Baker), and haven't already done so, you will want to check out the JellyCan documentation:
http://code.jellycan.com/files/show_menu2-README.txt
http://code.jellycan.com/sm2test/

It's fairly indepth and takes a bit to get the hang of but its very useful in customizing menus.

Good luck!

Michael
Title: Re: Adding title="LINKNAME" to generated menu links.
Post by: Stefek on June 08, 2009, 11:02:40 PM
Hello.

Yee, this is an example from this site:
Code: [Select]
<?php

 show_menu2
(
        
$aMenu          0,
        
$aStart         SM2_ROOT,
        
$aMaxLevel      SM2_CURR+1,
        
$aOptions       SM2_TRIM,
        
$aItemOpen      = &#39;[li][a][menu_title]</a>&#39;,
        
$aItemClose     = &#39;</li>&#39;,
        
$aMenuOpen      = &#39;[ul]&#39;,
        
$aMenuClose     = &#39;</ul>&#39;,
        
$aTopItemOpen   false,
        
$aTopMenuOpen   false
        
)


Look at the Line 
Code: [Select]
$aItemOpen      = '[li][a][menu_title]</a>',
This is the line which generates the opening of the Link, and outputs HTML like
<li><a href="#">the title</a>

You may change this like
 
Code: [Select]
$aItemOpen      = '[li]<a href="[url]" title="[page_title]">[menu_title]</a>',then you will get the title Attribute and by mouse-over you will get the page title.

Have Fun.
SM2 is not really hard, but you will have to study it with lots of practice.

Kind Regards,
Stefek