Jump to:

17452 Posts in 4473 Topics by 1971 members

Archive

SilverStripe Forums » Archive » Blog - show full post

Our old forums are still available as a read-only archive.

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

Page: 1 2
Go to End
Author Topic: 3612 Views
  • planetbrain
    Avatar
    Community Member
    12 Posts

    Re: Blog - show full post Link to this post

    Played some more and found that

    function mytlittletest() {
    return this->ParsedContent() ;
    }


    returned my the full blog entry but

    function mytlittletest() {
    return this->ParsedContent() ;
    }


    Always returned 4 for ALL the entries on my summary page (maybe just coincidence but that was the number of characters in my very short test post.

    Anyway playing about a bit

    and changing the original ParsedContent() function from

    function ParsedContent() {
    $parser = new BBCodeParser($this->Content);
    $content = new Text('Content');
    $content->value =$parser->parse();
    return $content;
    }

    to

    function ParsedContent() {
    $parser = new BBCodeParser($this->Content);
    $content = new Text('Content');
    $content->value = Convert::raw2xml($this->Content);
    return $parser->parse();
    }

    seemed to cure the problem and I was able to use

    function ShowFullPost() {
    if ($this->ParsedContent() == $this->ParagraphSummary()) {
    return false;
    } else {
    return true;
    }
    }

    Apart from the fact I have changed the released code, can anyone see any other issues with this solution??

    3612 Views
Page: 1 2
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.