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.

Customising the CMS /

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

How do I remove the Domain(s) text from the Behavior tab


Go to End


5 Posts   1354 Views

Avatar
Andrew Houle

Community Member, 140 Posts

22 July 2011 at 2:19am

This is basically a repeat of this thread (but it's read only now, so I couldn't respond on it) - http://silverstripe.org/archive/reply/4363 that was never resolved.

In the CMS, I've used this $f->removeByName("Domain(s)"); to get rid of the domain(s) field in the Behavior tab, but I'm left with "Use this page as the 'home page' for the following domains: (separate multiple domains with commas)". I've tried removeByName for that, but it doesn't work. Anyone know how to get rid of this?

Avatar
swaiba

Forum Moderator, 1899 Posts

22 July 2011 at 2:49am

try...

$f->removeByName("HomepageForDomain");

"Domain(s)" is the label, "HomepageForDomain" is the field name

Avatar
Andrew Houle

Community Member, 140 Posts

22 July 2011 at 3:07am

I tried these two variations, but no dice...

$f->removeByName("HomepageForDomain");
$f->removeFieldFromTab("Root.Behavior","HomepageForDomain");

Avatar
swaiba

Forum Moderator, 1899 Posts

22 July 2011 at 3:17am

my bad - I didn't read the other thread...

try

$f->removeByName("HomepageForDomainInfo");

it's a literal field, check the getCMS fields for sapphire/core/model/SiteTree.php

Avatar
Andrew Houle

Community Member, 140 Posts

22 July 2011 at 3:22am

Awesome! That did the trick. Thanks for the help.