Updated: 02/08/2011 12:29pm
When you add a new page to the SiteTree, its (Menu)Title is created based on the PageType ClassName, preceded by whatever translation of the keyword 'new'. This results in titles like 'new MyContactPage' where you'd want 'new contact page' or 'nieuwe contactpagina' based on the users locale... The user will change it anyway, but still it doen't look nice. To remedy:
Make sure you provide a translation for every pagetype's singularname in your languagefiles (if you use i18nTextCollector, it will do it for you):
$lang['en_US']['MyContactPage']['SINGULAR_NAME'] = 'contact page';
Next add the following code to your Page class (will work for alle extended pages as well):
function onBeforeWrite(){
parent::onBeforeWrite();
if (empty($this->ID)) {
$this->Title = _t('CMSMain.NEW', 'new') . ' ' . $this->i18n_singular_name();
}
}