Jump to:

17452 Posts in 4473 Topics by 1971 members

Archive

SilverStripe Forums » Archive » Changing the name of a page type

Our old forums are still available as a read-only archive.

Moderators: martimiz, Sean, biapar, Willr, Ingo, simon_w

Page: 1
Go to End
Author Topic: 2035 Views
  • artemb
    Avatar
    Community Member
    11 Posts

    Changing the name of a page type Link to this post

    Hi, everybody!

    I need to change the name of a page type from one that is generated from the class name to a more sensible one. How can I do this? I've tried setting the $add_action of the page type class, but it doesn't help.

    p.s. I mean the name that is displayed in the "create" dropdown

  • Phalkunz
    Avatar
    69 Posts

    Re: Changing the name of a page type Link to this post

    Well, you can create pretty much any name you like with class name.

  • artemb
    Avatar
    Community Member
    11 Posts

    Re: Changing the name of a page type Link to this post

    Just found a way. You have to have a translation like this:

    $lang['en_US']['MegaPage']['SINGULARNAME'] = "Super duper page";

  • Phalkunz
    Avatar
    69 Posts

    Re: Changing the name of a page type Link to this post

    Well, you use that but it's used for translation purpose. You can always do this

    class SuperDuperPage extends Page {
    ...
    }

  • artemb
    Avatar
    Community Member
    11 Posts

    Re: Changing the name of a page type Link to this post

    That's not flexible enough. This way I can make localized, formatted and all kinds of display names

    2035 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.