Help - Search - Members - Calendar
Full Version: Link Titles
Movable Type Community Forum > Additional Resources > Tips and Tricks
Basket Case
I've been searching all day for ways to add the following things to my blog.

a) category titles as tooltips to each relative link
b) for the comment author's URL to show in a tooltip when their name is hovered upon

I can't seem to find tips for either anywhere, so I was wondering if inserting the MTCategoryLabel & MTCommentAuthorLink tags as a link title would have the effect I'm looking for, or do I need to do something else?

Any help is appreciated. Thanks.
TweezerMan
QUOTE
I can't seem to find tips for either anywhere, so I was wondering if inserting the MTCategoryLabel & MTCommentAuthorLink tags as a link title would have the effect I'm looking for, or do I need to do something else?

I'd suggest using the MTCommentURL tag instead of the MTCommentAuthorLink tag. Beyond that, TRY IT. You might be surprised. wink.gif
Basket Case
Thanks for the feedback smile.gif

I tried the MTCommentURL tag, but I couldn't find anywhere to put it at first. I tried adding it before the end of the MTCommentAuthorLink tag, like this:

CODE
<span class="comments-post"><$MTCommentAuthorLink regex="1" spam_protect="1" title="<MTCommentURL>"$>


but that didn't work. It appended the link with the $> part of the tag, instead of incorporating it, & it also didn't add the authors link as a tooltip.

The category tag, however, was no problem. smile.gif

Would anyone be able to tell me where to put the MTCommentURL tag (or what code to use, if I need to use a completely different code entirely)?

Thanks.
TweezerMan
What version of MT are you running? MT3D already includes the comment author's URL as a title attribute in the MTCommentAuthorLink tag; if you're running MT 2.6x, a slight hack to the MT code might be in order here.
Basket Case
I'm running v2.64.

I've asked the authors of the blogs running v2.x if they could tell me how the managed to do this, but recieved no reply. I'm guessing it was probably a fluke. smile.gif
TweezerMan
Open up lib/MT/Template/Context.pm and scroll down to line 1136, which should be the following line:
CODE
       return sprintf qq(<a target="_blank" href="%s">%s</a>), $url, $name;

Change that line to the following:
CODE
       return sprintf qq(<a target="_blank" title="%s" href="%s">%s</a>), $url, $url, $name;

Save the edited Context.pm and upload it to your server in ASCII mode. Your MTCommentAuthorLink tags should now automatically have the comment author's URL as a tooltip (title attribute in the link).
Basket Case
Thanks!

. . .I just completed those steps, & the tooltip still isn't appearing. mellow.gif
TweezerMan
Depending on how your MT is configured, you may need to add "title" to your Sanitize Spec setting. Example:
CODE
a href target title,b,br/,p,strong,em,ul,li,blockquote
Basket Case
I can't believe I overlooked something so simple.

Thank you.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2009 Invision Power Services, Inc.