Jump to:

5520 Posts in 1734 Topics by 1223 members

Customising the CMS

SilverStripe Forums » Customising the CMS » drop down with list values in forms

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

Page: 1
Go to End
Author Topic: 1019 Views
  • S0crates9
    Avatar
    27 Posts

    drop down with list values in forms Link to this post

    I've seen this in the e-commerce module and wanted to know how to use it in the CMS for custom drop-downs:

    if( ! $fields->fieldByName( 'Country' ) ) $fields->push(new DropdownField('Country', 'Country', Geoip::getCountryDropDown()));
    }

    This one clearly calls a function to get the GEO target, but how do I add a list of values here? Oh, and for this example as well, how do I add a default value if nothing is found?

    Thanks for any hep in advance!

    1019 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.