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.

Blog Module /

Discuss the Blog Module.

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

HTML TAGS Showing up in blog posts


Go to End


4 Posts   2191 Views

Avatar
bigstack

Community Member, 2 Posts

10 May 2011 at 4:03am

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

Forum Moderator, 5523 Posts

10 May 2011 at 5:04pm

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

Community Member, 8 Posts

8 June 2011 at 11:27pm

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

Community Member, 8 Posts

9 June 2011 at 12:10am

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

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