Jump to:

1851 Posts in 1606 Topics by 561 members

Blog Module

SilverStripe Forums » Blog Module » Truncating the content on the blogholder

Discuss the Blog Module.

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

Page: 1
Go to End
Author Topic: 1702 Views
  • steve_nyhof
    Avatar
    Community Member
    224 Posts

    Truncating the content on the blogholder Link to this post

    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/

  • MULTIDOTS
    Avatar
    Community Member
    16 Posts

    Re: Truncating the content on the blogholder Link to this post

    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

  • steve_nyhof
    Avatar
    Community Member
    224 Posts

    Re: Truncating the content on the blogholder Link to this post

    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

  • steve_nyhof
    Avatar
    Community Member
    224 Posts

    Re: Truncating the content on the blogholder Link to this post

    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.

  • MULTIDOTS
    Avatar
    Community Member
    16 Posts

    Re: Truncating the content on the blogholder Link to this post

    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.

  • steve_nyhof
    Avatar
    Community Member
    224 Posts

    Re: Truncating the content on the blogholder Link to this post

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

  • juneallison
    Avatar
    Community Member
    108 Posts

    Re: Truncating the content on the blogholder Link to this post

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

    1702 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.