Forum for discussing general topics related to Couch.
2 posts Page 1 of 1
Hi

Is there a recommended best practice with CouchCMS to manage long drop down list ? (190 countries for example)

Do I need to create 1 cloneable template, and have 1 page per country?
Or use some kind of JSON with all items?
other idea?

Is there a way to load countries, only when user clicks on dropdown (cms:ajax?)

All ideas are welcome

Thanks
The best practice is a little different with the goal to avoid generating of options in the primetime.

Tag <pages> or <show_repeatable> work fast and database fetches values quickly, but time is wasted for the internal transfer: database → php.

Thus, it is best to save a database call, generate a static snippet with options upon admin-panel page save (configuring with tag config_form_view, use a Repeatable Region editable (also placed inside a Couch "Globals section") and embed the static snippet as text. The embedding will be more efficient if done without processing.

However, countries is something that is rarely changed. Just use a static HTML / JSON. Ajax is possible, but why? Too cumbersome for a small list. Easyautocomplete JS library can load Ajax plus autocomplete the value.
2 posts Page 1 of 1