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're retiring the forums!

The SilverStripe forums have passed their heyday. They'll stick around, but will be read only. We'd encourage you to get involved in the community via the following channels instead:

Customising the CMS /

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

wordwrap text in Dropdownfield


Go to End


2 Posts   1903 Views

Avatar
snaip

Community Member, 181 Posts

28 January 2009 at 9:35pm

Edited: 28/01/2009 9:57pm

hi

how to use wordwrap in DropdownField in CMS ?

return new FieldSet(
  new DropdownField('File_name','Select image:',DataObject::get("File")->toDropdownMap('Filename',wordwrap('Filename', 50, "\n", 1)))
)

what is wrong ?

Avatar
Hamish

Community Member, 712 Posts

29 January 2009 at 10:05am

Are you trying to wrap the Filename of each file in the in the drop down?

You can't. Select fields will always be rendered by browsers on a single line. That's an HTML limitation, not a silverstripe one.