Add Title Attribute To SP

Mick in Tutorials on Aug 27, 2013


According to World Wide Web Consortium (W3C) , 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.


Hover the article titles and you'll see the "tool tip".


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>',






Tagged with:


Mick

Mick G

  idesignsmf.com

    

Mick is an American theme designer for Simple Machines Forum software currently living in South Florida, USA. He runs idesignSMF and started tinkering with SMF in 2006 where he created several SMF forums of his own before he founded idesignSMF in 2009 to which he is dedicated full time and has a weakness for Pizza.

  Connect with us:

     

  Improve SMF

If you wish to contribute to the development of SMF you can contribute to the coding discussions taking place on Github. You are also welcome to suggest features which you would like to see added to the software in the Feature Requests board.

  Receive our monthly newsletter right in your inbox.
Commitment issues? Unsubscribe at any time.

Get 100% complete access to our entire collection and find out why 11,210 SMF owners prefer our themes



0 Comments








  Responsive SMF Themes. We're currently working on brand spankin' new Responsive SMF themes for SMF 2.1