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.

Template Questions

Where can i change the names of templates?


7 Posts   1334 Views


6 April 2011 at 2:39am Community Member, 15 Posts

I have developed some custom templates like "Application Page" or "Home Page". Now I'd like to rename their titles so that they show correctly in my language "Anwendungsseite" or "Startseite.

How can this be done?
Where would i have to look?


6 April 2011 at 8:21am Forum Moderator, 1796 Posts

It's available as an option within the Page edit form, then Content tab --> Meta data tab --> Title
(save & publish)


7 April 2011 at 9:48pm Community Member, 15 Posts

Thank you :)

But that was not exactly my question. I wanted to change the title that appears on the left column when you create a new page with a given template. I thought there would be some kind of language file where i could define these names but i didn't find it. I know sapphire (or the cms) creates the names from the names of the files so i:

- copied my template files and renamed the copys with the new name
- then i made all existing sites use the new templates
- after that i deleted the old templates and also a few db tables that didn't get correctly deleted

Now at least i have the correct name, but only in English - what i wanted was, have the name in German as well ;)


7 April 2011 at 9:53pm Forum Moderator, 1796 Posts

Are you using the translatable?
When enabled that allows for pages to be translated and all content (including titles) can be locale specific


15 April 2011 at 8:07pm Community Member, 15 Posts

Thank you - i'll definitely look into that :)


15 April 2011 at 11:25pm Community Member, 19 Posts

Hi Steffi,

try putting

static $singular_name = "My super Page";

in your pages



16 April 2011 at 2:55am Forum Moderator, 1091 Posts

When creating a new page in the cms, it will appear in the sitetree on the left, named something like 'new MySpecialPagetype' or 'neue MySpecialPagetype'... That had been bothering me for a while.

First, to translate a custom pagetype to a proper name, place this in your languagefile mysite/lang/de_DE.php:

$lang['de_DE']['MySpecialPagetype']['SINGULARNAME'] = 'German name for this pagetype';

This will translate the entries in the Create Page dropdown, but still won't work for the name generated for new pages in the SiteTree. But now you can, in your mysite/code/page.php Page class, something like this:

function onBeforeWrite(){
   if (empty($this->ID)) {
      $this->Title = _t('CMSMain.NEW', 'new') . ' ' . $this->i18n_singular_name();