Add Title Attribute To SP

Started by Mick, Aug 27, 2013

Aug 27, 2013 Last Edit: Aug 18, 2018 by Mick

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