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.

Customising the CMS /

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

Disabling prototype for page comments


Go to End


2 Posts   2822 Views

Avatar
Anatol

126 Posts

11 February 2010 at 4:14pm

Edited: 11/02/2010 4:15pm

Hi,

just in case this might help anyone. I'm building a site that uses the Mootools framework (in the frontend). It all works well, but when I allow comments on a page Silverstripe adds javascript validation with the Prototype JS framework. This creates a conflict with Mootools. You may run into similar problems with other frameworks such as jQuery.

To get rid of Prototype you need to disable both AJAX commenting (in _config.php):

PageCommentInterface::set_use_ajax_commenting(false);

and remove the form validation (in e.g. Page.php):

class Page_Controller extends ContentController {
	
	public function init() {
		parent::init();
		Validator::set_javascript_validation_handler('none');
	}

Cheers!
Anatol

Avatar
Andrew Houle

Community Member, 140 Posts

24 February 2011 at 6:45am

Thanks for taking the time to post this! I was running into the same issues (predictably so) with the jQuery library.

Andy