By Groupe Média Théapolis on Saturday, 04 May 2019
Posted in General Issues
Likes 0
Views 631
Votes 0
Hello,

We would like to be able to trim the text of articles in the layout of our homepage, even when it is a text crop by an introductory splitter (block "read more").

The truncation parameter does not work when the author uses a "Read more" block. But we encourage our authors to use it.

For now, authors can make long introductions, which can make the homepage less beautiful. In their blog page, they do what they want, but in the home page we would like harmony.

We tried to limit the number of characters/words on the following zone <?php echo $post->getIntro();?> in the file /components/com_easyblog/themes/nickel/blogs/latest/default.main.php . But without good result.

The top would be to trim the text based on the number of words (not the number of characters) and finish with an ellipsis for more aesthetics when the sentence is cut.

Do you have a solution (html, css, etc.) ? It would save us.

Best regards.
Hi there,

Can you try to apply attached file at this path template/your_current_template/html/com_easysocial/blogs/latest/default.main.php and see how it goes. Steps prompted are based on template override as you can see here https://stackideas.com/docs/easyblog/administrators/customizations/template-overriding

For you information, i have changed those codes accordingly as given below. You can configure how many words you wanted to truncate, by changing 150 on the codes accordingly.

[gist type="php"]

//original codes
<?php echo $post->getIntro();?>

//replaced with this codes
<?php echo substr($post->getPlainContent(), 0, 150);?>
[/gist]

Please give it a try and see how it goes.
·
Monday, 06 May 2019 11:07
·
0 Likes
·
0 Votes
·
0 Comments
·
Hello,

We use the Nickel theme. When we put the file you sent, the entire layout is destroyed.

If it is not possible to truncate by the number of words, it is better to use the expected parameter. We will stop using the block "Read more". We are satisfied with the result.

Thank you for your help.

Best regard.
·
Monday, 06 May 2019 22:06
·
0 Likes
·
0 Votes
·
0 Comments
·
Hi there,

You are most welcome And yes, it is impossible to achieve this as you have used readmore on your blogpost currently

Just for your information, I have locked and marked this thread as resolved to avoid confusions in the future. Please start a new thread if you have any other issue in the future so it will be easier for us to manage your inquiries.

Thanks for understanding.
·
Tuesday, 07 May 2019 09:13
·
0 Likes
·
0 Votes
·
0 Comments
·
View Full Post