Im want to make post editor for Page Content (for good typography, like set up right dashes and quotes), i may call it every time i render page, but better and quicker solution is change Content before saving. So how i may do it?
Thank you.
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.
You can define a onBeforeWrite function on your page type. Eg if you want to edit the page content before you write to the database you would need to add this to your mysite/code/Page.php in the Page class
function onBeforeWrite() {
// do something
parent::onBeforeWrite();
}
For more information see http://doc.silverstripe.com/doku.php?id=datamodel#onbeforewrite