1770 Posts in 495 Topics by 531 members
Blog Module
SilverStripe Forums » Blog Module » Truncating the content on the blogholder
Discuss the Blog Module.
Moderators: martimiz, Howard, Sean, Ryan M., biapar, Willr, Ingo, swaiba, simon_w
|
Page:
1
|
Go to End | |
| Author | Topic: | 1451 Views |
-
Truncating the content on the blogholder

16 November 2009 at 10:49am Last edited: 16 November 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
-
Re: Truncating the content on the blogholder

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
-
Re: Truncating the content on the blogholder

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 -
Re: Truncating the content on the blogholder

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.
-
Re: Truncating the content on the blogholder

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.
-
Re: Truncating the content on the blogholder

18 November 2009 at 8:26am
I kind of thought so, I'm good! Thank you
-
Re: Truncating the content on the blogholder

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!
| 1451 Views | ||
|
Page:
1
|
Go to Top |



