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.

Customising the CMS

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


Reply

5 Posts   790 Views

Avatar
Andrew Houle

22 July 2011 at 2:19am Community Member, 132 Posts

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

22 July 2011 at 2:49am Forum Moderator, 1796 Posts

try...

$f->removeByName("HomepageForDomain");

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

Avatar
Andrew Houle

22 July 2011 at 3:07am Community Member, 132 Posts

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

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

Avatar
swaiba

22 July 2011 at 3:17am Forum Moderator, 1796 Posts

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

22 July 2011 at 3:22am Community Member, 132 Posts

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