Uutiset:

Want to get involved in developing SMF, then why not lend a hand on our github!

Main Menu
Advertisement:

Keeping post titles from spilling over on 2nd line on recent posts block

Aloittaja wynnyelle, joulukuu 19, 2013, 09:40:18 IP

« edellinen - seuraava »

wynnyelle

I am attaching a screenshot with the problem titles circled in red so you see what I mean. What I want to do is prevent spill-over, either by shortening the board names, the post subject names, or, probably, both.

Is there an easy way to do this? I was thinking it would be shortened by the use of the ellipses. Just putting a "..." at the end of a certain number of characters to indicate there's more, but there's no room for it on this page.


margarett

I'm not sure, but it won't be easy... The list of recent topics is built using dt/dd tags and their size is automatic depending on the resolution.
I guess it would require to transform that into a table.
Se forem conduzir, não bebam. Se forem beber... CHAMEM-ME!!!! :D

LainaaOver 90% of all computer problems can be traced back to the interface between the keyboard and the chair

Kays

Hi, in looking at this it's not really that difficult to do. ;)

In Subs-Recent.php in the Sources directory, look for:


'link' => '<a href="' . $scripturl . '?topic=' . $row['id_topic'] . '.msg' . $row['id_msg'] . ';topicseen#msg' . $row['id_msg'] . '" rel="nofollow">' . $row['subject'] . '</a>'


And replace it with:


'link' => '<a href="' . $scripturl . '?topic=' . $row['id_topic'] . '.msg' . $row['id_msg'] . ';topicseen#msg' . $row['id_msg'] . '" rel="nofollow" title="' . $row['subject'] . '">' . shorten_subject($row['subject'], 15) . '</a>'


It's currently set at 15 characters. If that's either too much or too little, adjust the 15 at the end of that line according.

I've also added a title attribute so the complete subject name is shown if the user mouses over the link.

If that's not sufficient, this also could be done with the board names. However I would suggest that you try decreasing the font size a wee bit first. :)

As usual, do back up that file before making any changes to it.

If at first you don't succeed, use a bigger hammer. If that fails, read the manual.
My Mods

Advertisement: