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.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

Data Model Questions /

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

bug removing tabs?!


Go to End


2 Posts   3082 Views

Avatar
mabraham

Community Member, 2 Posts

15 March 2009 at 3:27am

Edited: 15/03/2009 12:04pm

hello community,

i began working with silverstripe a week ago and i've some questions of course.
i tried the irc-channel. problems seems i am from germany and when i ask my questions, everybody in nz seems to sleep. ;)
this is why i post here.

here is my first questions:

does anybody know a secure way to remove a tab from the cmsfields?
removeByName and removeFieldFromTab doesn't work as supposed if you change the interface language.

e.g.
if you try to remove the report tab:
$fields->removeFieldsFromTab('Root','Reports')

it works, if your interface language is english, but if you switch to german the tab isn't removed. to remove the tab from german interface you will have to remove it using the german name of the tab 'Berichte'.

that is not, what you expect.

regards,

martin

Avatar
mabraham

Community Member, 2 Posts

16 March 2009 at 9:31am

my fault... sorry for the 'bug' in the title.

the solution is:
$fields->removeByName(_t('SiteTree.TAB<TABTODELETE>'))

the _t()-function does the translation for you. see http://doc.silverstripe.com/doku.php?id=i18n&s=translate

Martin