Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

Blog Module /

Discuss the Blog Module.

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo, swaiba

Truncating the content on the blogholder


Go to End


7 Posts   2705 Views

Avatar
steve_nyhof

Community Member, 224 Posts

16 November 2009 at 10:49am

Edited: 16/11/2009 10:50am

I have added 150x150px images to the beginning of my blog post so that is will show up on the blog holder. However, I will like to increase the content length so that it looks better.

I have looked in the BlogHolder.php file for info ???

see page

http://landingpages.ws/blog/

Avatar
Multidots

Community Member, 16 Posts

18 November 2009 at 12:05am

Hello steve_nyhof,

You can increase the content length by changing the following code in your "/blog/code/BlogEntry.php"

Current Code :
function ParagraphSummary(){
if(self::$allow_wysiwyg_editing) {
return $this->obj('Content')->FirstParagraph('html');
} else {
$parser = new BBCodeParser($this->Content);
$html = new HTMLText('Content');
$html->setValue($parser->parse());
return $html->FirstParagraph('html');
}
}

New Code :
function ParagraphSummary(){
if(self::$allow_wysiwyg_editing) {
return $this->obj('Content')->BigSummary(200);
} else {
$parser = new BBCodeParser($this->Content);
$html = new HTMLText('Content');
$html->setValue($parser->parse());
return $html->BigSummary(200);
}
}

I hope this will help you :)

Avatar
steve_nyhof

Community Member, 224 Posts

18 November 2009 at 4:00am

Yes and no.

I have had this issue with wordpress also, it removes the html - I want the pictures to stay - any ideas for that?

Thank you,
Steve

Avatar
steve_nyhof

Community Member, 224 Posts

18 November 2009 at 4:18am

I got my page to look good by adding a side area.

I just need to get my archives working - have it in dev mode, any ideas to fix this? I have tried some things on the forum, but I get the same result.

Avatar
Multidots

Community Member, 16 Posts

18 November 2009 at 7:46am

Hello steve_nyhof,

If you want to increase the content length, then before that it must remove html tags. Because the content length which we specify for display content is counted by word. If the html tag has not removed then may possible it return invalid html and it disturb the whole design of your site.

Avatar
steve_nyhof

Community Member, 224 Posts

18 November 2009 at 8:26am

I kind of thought so, I'm good! Thank you

Avatar
juneallison

Community Member, 110 Posts

19 July 2011 at 8:43am

@MULTIDOTS Thank you for sharing that bit of code. I just used it and it worked great. Thank you!