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

Editing tools not appearing with Content form when Posting new entry


Go to End


2 Posts   1761 Views

Avatar
MCK

Community Member, 18 Posts

12 February 2015 at 4:37pm

I have installed the blog module, etc., successfully, but when adding a blog entry via /blog (logged in as Admin) I can add a new entry cannot style the text using either bbcode or html. No tools appear at the top of the Content section of the form. If I try adding bbcode text in it just puts the codes in with the text, i.e., they are not interpreted as codes. I have also tried enabling HTML editing (config.php BlogEntry::allow_wysiwyg_editing();) but still no tools appear. Is this likely to be a Javascript problem? If so, where should I be looking?

Avatar
thomas.paulson

Community Member, 107 Posts

12 February 2015 at 6:23pm

RichText reqiure HtmlEditorField_Toolbar instance on frontend, while on backend it is instaintated automatically ,
so add the this 'EditorToolbar' method to Page_Controller

class Page_Controller extends ContentController {

/**
* An array of actions that can be accessed via a request. Each array element should be an action name, and the
* permissions or conditions required to allow the user to access it.
*
* <code>
* array (
* 'action', // anyone can access this action
* 'action' => true, // same as above
* 'action' => 'ADMIN', // you must have ADMIN permissions to access this action
* 'action' => '->checkAction' // you can only access this action if $this->checkAction() returns true
* );
* </code>
*
* @var array
*/
private static $allowed_actions = array (
);

public function init() {
parent::init();
// You can include any CSS or JS required by your project here.
// See: http://doc.silverstripe.org/framework/en/reference/requirements
}

public function SayHello($name = 'thomas'){
return $this->PrintHello($name);
}

public function EditorToolbar() {
return HtmlEditorField_Toolbar::create($this, "EditorToolbar");
}
}

Also $EditorToolbar , in Page.ss Layout file.