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   843 Views

Avatar
Andrew Houle

Community Member, 132 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, 1804 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, 132 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, 1804 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, 132 Posts

22 July 2011 at 3:22am

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