By David on Sunday, 13 November 2016
Posted in Technical Issues
Likes 0
Views 245
Votes 0
Would it be possible to truncate the blog title? I am using an RSS feed importer and the titles are very long. I'd like to truncate thing on the homepage. Please help.

David
Hello David,

It's not possible to truncate the title from the settings but if you edit the template file, you could use a simple method to truncate the title. The file you should be looking at is at /components/com_easyblog/themes/wireframe/blogs/latest/default.main.php

Locate for the codes below at line 97,


<a href="<?php echo $post->getPermalink();?>" class="text-inherit"><?php echo $post->title;?></a>


Replace it with,


<a href="<?php echo $post->getPermalink();?>" class="text-inherit"><?php echo JString::substr($post->title, 0, 50);?></a>


Where 50 is the maximum characters for the title.

P/S: Please take note that support is not provided for customizations and we are just assisting you out of good faith.
·
Sunday, 13 November 2016 13:38
·
0 Likes
·
0 Votes
·
0 Comments
·
Awesome!!! Thanks so much! Two questions that would really make it PERFECT for me:

1) Instead of truncation by characters - is there a way to do it by number of words?
2) Would there be a way to add an ellipses (...) at the end?

Thanks,

David
·
Sunday, 13 November 2016 16:35
·
0 Likes
·
0 Votes
·
0 Comments
·
Hello David,

Unfortunately that codes which I provide doesn't truncate it by words. If you need ellipses, you need to manually add it in the code
·
Monday, 14 November 2016 13:32
·
0 Likes
·
0 Votes
·
0 Comments
·
Thank you soooo much

David
·
Tuesday, 15 November 2016 14:28
·
0 Likes
·
0 Votes
·
0 Comments
·
Hey David,

You are most welcome. Glad to know we are able to help.

As a gentle reminder, kindly start a new thread if you have any other issue in the future so it will be easier for us to manage your inquiry. I will lock and mark this thread as resolved.
·
Tuesday, 15 November 2016 15:08
·
0 Likes
·
0 Votes
·
0 Comments
·
View Full Post