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.

Blog Module

Discuss the Blog Module.

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

HTML TAGS Showing up in blog posts


Reply

4 Posts   1229 Views

Avatar
bigstack

10 May 2011 at 4:03am Community Member, 2 Posts

not sure if this is a blog module problem or a regular site problem.

but when ever i make a post and use the wsywig editor to add in html tags the html is not parsed and all the tags are shown as plain text.

I am a new user to silverstripe, so maybe i just did something wrong in the editor...

but even when i delete everything and simply try and put a blockquote in to a empty page it shows the html tags on the published site.

Unless someone can give me an explanation or solution in the next 48 hours i will be moving on from silverstripe. It appeared to be a simple solution and a good alternative to wordpress, but it is just not there yet, I have had several other glitches that I have figured out and I am just not up for fixing others problems, I just wanted to have a cms/blog that was easy to setup and deal with and that is just not happening, good luck with your project.

Avatar
Willr

10 May 2011 at 5:04pm Forum Moderator, 5511 Posts

Have you enabled wyiwyg editing for the blog module? http://api.silverstripe.org/modules/blog/trunk/blog/BlogEntry.html#methodallow_wysiwyg_editing. Out of the box I do believe it uses BBCode rather than HTML.

You will need this in your config file to enable it

BlogEntry::allow_wysiwyg_editing();

Avatar
Anonymous user

8 June 2011 at 11:27pm Community Member, 8 Posts

I am having the same issue of the blog entries showing the html code and seems to think it is parsing BBS code (or something!). BUT in the BlogEntry.php file it shows as being set for WYSIWYG:

/**

    * Is WYSIWYG editing allowed?

    * @var boolean

    */

   static $allow_wysiwyg_editing = true;

   

   /**

    * Is WYSIWYG editing enabled?

    * Used in templates.

further on it tests to see if it is set or not:

   /**

    * Get a bbcode parsed summary of the blog entry

    */

   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');

      }

   }

The code should assume WYSIWYG editing is turned on but somehow doesn't. Does anyone have any ideas?

Cheers
Pete

Avatar
Anonymous user

9 June 2011 at 12:10am Community Member, 8 Posts

A little bit more searching found the answer in this post:

http://silverstripe.org/general-questions/show/5932#post256657