Hi,
I am using SimpleTreeDropdownField within DOM.
Is there a way not to select a page? I want to make the selection optional but the homepage is alway selected per default.
Thanks much
patte
This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.
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.
Discuss the DataObjectManager module, and the related ImageGallery module.
Moderators: martimiz, UncleCheese, Sean, Ed, biapar, Willr, Ingo, swaiba
Hi,
I am using SimpleTreeDropdownField within DOM.
Is there a way not to select a page? I want to make the selection optional but the homepage is alway selected per default.
Thanks much
patte
$myDropdown->setEmptyString('-- Please select --');
Thanks for your help UncleCheese :-)
Can you please give me another hint where to place setEmptyString?
public function getCMSFields_forPopup()
{
return new FieldSet(
new SimpleTreeDropdownField("MyUrlID", "Bitte waehlen Sie das Ziel aus", "SiteTree")
);
}
public function getCMSFields_forPopup()
{
$f = new FieldSet(
$dropdown = new SimpleTreeDropdownField("MyUrlID", "Bitte waehlen Sie das Ziel aus", "SiteTree")
);
$dropdown->setEmptyString(...);
return $f;
}
UncleCheese, you`re the best! Thanks much