simplify
Total posts: 5
27 Апр 2015 10:07

Hi,

i'm new to cobalt, i create a field with type selectbox, it's possible to create also optgroups? If not, it's there any solutions? I need for example something like this:

Region - Citys...

Последние изменения: 29 Апр 2015


pepperstreet VIP
Total posts: 3,837
28 Апр 2015 17:55

Hello simplify,

AFAIK, not as a parameter in field configuration.
What is the amount and source of your data?


Some Ideas / Workarounds

  • Select field has a parameter Color Separator. You might add the Region name instead of a color. In a custom form input template, you might parse and group the values based on the RegionName. Requires PHP/arrays knowledge)

  • Select field could also be populated by a custom SQL.
    (you might store your Regions/Cities in extra DB table, or maybe utilize J! Cat/Art, or J! hierarchical Tags? Still needs work on a custom form input template, to create the necessary optgroup markup...)

  • Have a look at commercial field Multi Level Select

  • What about Category/Subcategory structure?
    You can disable submission for parent categories (Regions). On submission form and category selectbox they will show-up as visual separators!


simplify
Total posts: 5
28 Апр 2015 20:24

Hi,

i solved it with Category/Subcategory structure.

Cobalt is very nice :)


pepperstreet VIP
Total posts: 3,837
29 Апр 2015 01:00

simplify i solved it with Category/Subcategory structure.

You are welcome! Glad I could help out.
BTW, thanks for your question, which reminded me to make a feature request ;)

Работает на Cobalt