Aug 10, 2013 14:42:46 GMT -5
Hey all,
I was wondering if there was a way to restrict thread titles in the Last Post column. So if they are too long, they simply trail away in a "..."
Here is an image of what I mean:
imgur.com/YGpxalJIn that screenshot is an old forum (V4). In the Last Post column, there is a post by Professor Trelawney in the thread "Divination Lesson 4 - Palmistry," but the thread title is cut off to "Divination Lesson 4 - P..."
I want to cut off thread titles because the long ones make board sizes look really wonky on the main page
Thanks for any help you can give!
Aug 10, 2013 15:49:58 GMT -5
Hey all,
I was wondering if there was a way to restrict thread titles in the Last Post column. So if they are too long, they simply trail away in a "..."
Here is an image of what I mean:
imgur.com/YGpxalJIn that screenshot is an old forum (V4). In the Last Post column, there is a post by Professor Trelawney in the thread "Divination Lesson 4 - Palmistry," but the thread title is cut off to "Divination Lesson 4 - P..."
I want to cut off thread titles because the long ones make board sizes look really wonky on the main page
Thanks for any help you can give!
Hi, I actually needed help with this too a little while ago, and Brian helped me with it, posting a code for me:
support.proboards.com/thread/450006/req-shorten-links
Aug 10, 2013 18:40:30 GMT -5
Hmm I looked at that thread and I wasn't sure what to do! (I should've mentioned that I'm not very experienced with coding.)
Did the code in his first reply work for you? Because it did nothing on my forum. His post says to "change every link manually in layout templates" and I'm not sure what that means
Aug 10, 2013 19:09:27 GMT -5
Hmm I looked at that thread and I wasn't sure what to do! (I should've mentioned that I'm not very experienced with coding.)
Did the code in his first reply work for you? Because it did nothing on my forum. His post says to "change every link manually in layout templates" and I'm not sure what that means
Just heading down stairs for 10 - 15mins, but when I come back I shall explain - or tr- for you.
Here I have it working on one of my themes:
stinky666themes2.freemessageboards.com/If you look at the General Board, the link is shortened.
Edit...Ok so here we go...
Grab the code from the above topic:
<script type="text/javascript">
var threads = document.getElementsByTagName('a');
var thread_max = 18;
for(var ti=0; ti < threads.length; ti++) {
if(threads[ti].className == "lastpost" && threads[ti].innerHTML.length > thread_max)
threads[ti].innerHTML = threads[ti].innerHTML.substring(0,thread_max)+"...";
}
</script>
(Quick Note: I have the above to add the "..." after 18 characters. Look on the third line of the above code to change the character cut off:
var thread_max = 18;)
Go to
Admin > Themes > Layout Templates > Forum WrapperAt the very bottom, make a couple of new lines, and paste that code there. Click save. Now go back into the Layout Templates, but this time click on "
Board" and then the "
Board List" tab. On a default theme, go to line 38 and you should see:
$[board.last_thread.recent_link]<br />Replace that with the following:
<a href="$[board.last_thread.recent_link.href]" class="lastpost">$[board.last_thread.subject]</a><br />Hit save and voila. Should work
Aug 10, 2013 20:45:01 GMT -5
It worked! Thanks so much for the extra help!
Aug 10, 2013 20:55:24 GMT -5
It worked! Thanks so much for the extra help!
No worries. Anything else, just ask
Apr 3, 2020 1:43:14 GMT -5
Sorry for bumping an old thread but is there anyway to have a tooltip pop-up and show the whole thread title when you hover over the shortened thread title?