Simple Machines Community Forum

Customizing SMF => Tips and Tricks => Topic started by: Mick. on September 11, 2013, 07:48:57 PM

Title: Add Title Attribute To SimplePortal Front Page
Post by: Mick. on September 11, 2013, 07:48:57 PM
(http://idesign.idesign360com.netdna-cdn.com/images/sptitle.png)

According to World Wide Web Consortium (W3C) (http://www.w3.org/) , the title attribute "offers advisory information about the element for which it is set." W3 goes on to state that "visual browsers frequently display the title as a "tool tip" (a short message that appears when the pointing device pauses over an object)." and "setting the [title] attribute on a link allows user agents (visual and non-visual) to tell users about the nature of the linked resource."

By default SimplePortal does not use the title attribute on its article page. With a simple bit, we can add this to the PortalArticles.php file.

Demo: Hover on article titles to see the tooltip.  http://idesign360.com/community

Open /Sources/PortalArticles.php and find:

'link' => '<a href="' . $scripturl . '?topic=' . $row['id_topic'] . '.0">' . $row['subject'] . '</a>',


Replace with:

'link' => '<a href="' . $scripturl . '?topic=' . $row['id_topic'] . '.0" title="' . $row['subject'] . '" >' . $row['subject'] . '</a>',
Title: Re: Add Title Attribute To SimplePortal Front Page
Post by: TomW on October 07, 2013, 02:22:19 PM
Nice one, thanks Mick.
Title: Re: Add Title Attribute To SimplePortal Front Page
Post by: Bigguy on October 07, 2013, 06:53:30 PM
Nice trick Mick, thanks. :) Your image is not showing btw.
Title: Re: Add Title Attribute To SimplePortal Front Page
Post by: amadeos on November 18, 2013, 09:16:31 AM
hmmm, that is something i will use)