Jump to:

23550 Posts in 19336 Topics by 2890 members

General Questions

SilverStripe Forums » General Questions » Two possible bugs regarding custom CMS fields and Translatable?

General questions about getting started with SilverStripe that don't fit in any of the categories above.

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

Page: 1
Go to End
Author Topic: 354 Views
  • smares
    Community Member
    25 Posts

    Two possible bugs regarding custom CMS fields and Translatable? Link to this post

    Assuming I want to remove the MenuTitle field in CMS from all pages and return Title instead, I modify Page.php by overwriting getCMSFields()

    public function getCMSFields() {
    $fields = parent::getCMSFields();
    return $fields;

    and adding getMenuTitle:

    public function getMenuTitle() {
    return $this->Title;

    This works fine when viewing the page in the default locale, but when switching to a localized version of the page, the text field for MenuTitle is gone, but the original value in English is still displayed. See the first screenshot.

    The second problem is when adding elements before other ones. addFieldToTab accepts as third parameter the name of the field to insert before. Again, in English everything appears OK, but in localized versions of the page, the fields are nested incorrectly because of the original version that appears below the input field. See the second screenshot.

    Attached Files
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.