Simple Machines Community Forum

Customizing SMF => Modifications and Packages => Mod Requests => Topic started by: kmlkmljkl on August 06, 2016, 07:23:54 AM

Title: Adding titles to the navigation links
Post by: kmlkmljkl on August 06, 2016, 07:23:54 AM
Like this:
(http://i.imgur.com/nN6cJc7.png)

I won't really need an actual mod for it, just some instructions would be nice.
Thanks
Title: Re: Adding titles to the navigation links
Post by: Illori on August 06, 2016, 09:18:23 AM
do you mean this? http://wiki.simplemachines.org/smf/Buttons_-_How_do_I_add_buttons_to_SMF_2.0
Title: Re: Adding titles to the navigation links
Post by: kmlkmljkl on August 06, 2016, 10:04:37 AM
thanks for the link, but it doesn't seem to talk about tooltips
Title: Re: Adding titles to the navigation links
Post by: Grammy on August 06, 2016, 10:11:34 AM
I've not seen any mods that do that here, but you can always achieve it with CSS.  Here's an example of what can be done:

How to create tooltips with CSS (http://www.w3schools.com/howto/howto_css_tooltip.asp)

(You'd have to echo a div class and span class for each button.)
Title: Re: Adding titles to the navigation links
Post by: Kindred on August 06, 2016, 10:45:05 PM
In the subs.php array, add the title attribute to the href action of the menu object
Title: Re: Adding titles to the navigation links
Post by: Grammy on August 06, 2016, 11:19:47 PM
Quote from: Kindred on August 06, 2016, 10:45:05 PM
In the subs.php array, add the title attribute to the href action of the menu object


And that'll create a tooltip?  Wow!  I'm glad I hang out here; I learn a lot lurking around you guys.    :)
Title: Re: Adding titles to the navigation links
Post by: kmlkmljkl on August 07, 2016, 03:27:20 AM
Quote from: Kindred on August 06, 2016, 10:45:05 PM
In the subs.php array, add the title attribute to the href action of the menu object

thanks! this works when I add a link myself, like this:
'href' => 'http://website.com/page" title="Tooltip"'
but I can't figure out what to do with the scripturl ones
'href' => $scripturl
anything I do to that just breaks the entire forum...

Guess I'll un-solve the thread then :p
Title: Re: Adding titles to the navigation links
Post by: Kindred on August 07, 2016, 09:10:32 AM
'href' => $scripturl, 'action=something', 'title="Tooltip"',

I think that should work
Title: Re: Adding titles to the navigation links
Post by: kmlkmljkl on August 07, 2016, 09:21:59 AM
Quote from: Kindred on August 07, 2016, 09:10:32 AM
'href' => $scripturl, 'action=something', 'title="Tooltip"',

I think that should work

Nope, doesn't work.
Though I could probably replace all the ?action links with actual links and then do it like what I posted, but I don't know if that's a good idea or not.
Title: Re: Adding titles to the navigation links
Post by: Arantor on August 08, 2016, 02:00:27 AM
It's not a good idea, no.

'item' => $scripturl . '?action=whatever" title="my title',
Title: Re: Adding titles to the navigation links
Post by: kmlkmljkl on August 08, 2016, 04:07:32 AM
Thanks man, that works.
Doesn't work for the home link though, but I guess the icon for it ((http://www.famfamfam.com/lab/icons/silk/icons/house.png)) is obvious enough.
Title: Re: Adding titles to the navigation links
Post by: Arantor on August 08, 2016, 04:56:10 AM
'href' => $scripturl . '" title="Home',
Title: Re: Adding titles to the navigation links
Post by: kmlkmljkl on August 08, 2016, 07:01:28 AM
thanks! :D