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.

Archive /

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

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

Blog - show full post


Go to End


9 Posts   4840 Views

Avatar
planetbrain

Community Member, 12 Posts

3 September 2008 at 9:35am

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??

Go to Top