I'm a SS newbie but I really love the system!
I'm Polish. In my language leaving one letter words at the end of the line is a mistake. I know i can deal with it adding after such words.
I'm trying to modify Content using onBeforeWrite() inside Page_Controller so it would work on every custom class extending from it.
public function onBeforeWrite() {
parent::onBeforeWrite();
$text = $this->getField('Content');
$text = preg_replace('/(?<=\b[a-z]) /i', ' ', $text);
$this->setField('Content',$text);
}
It's not working at all and I don't know why.
Is there any way to modify content before it gets wrapped into HTML or should I try to create plugin for TinyMCE that takes care of it?
Is there anything similar to Drupal or Wordpress text filters?
I did some research but it all leads to documentation which isn't much help for a newbie - at least in this case.