List Options

4 posts by 3 authors in: Forums > CMS Builder
Last Post: May 24, 2008   (RSS)

By gethudson - May 20, 2008

Hi All,

When using Admin to set up a 'list option', I would like the option to show, for example, 'UNITED KINGDOM', but actually return 'UK', to the database. How do I achieve this in CMSBuilder? Or do I create a little section and then have the list reference it instead of hardcoding?

Have I just answered my own question!?!?! [blush]

Re: [gethudson] List Options

By Dave - May 20, 2008

You can create another section for it or specify your list option values like this:

UK|United Kingdom

Just enter the value you want, then a pipe symbol ("|") then the label you want displayed.

Hope that helps! :)
Dave Edis - Senior Developer
interactivetools.com

Re: [Perchpole] List Options

By Dave - May 24, 2008

Hmm, I can't think of any simple way to do that. If you didn't have too many options you could use an if statement like this:

<?php
if ($record['category'] == "UK") { print "United Kingdom"; }
if ($record['category'] == "US") { print "United States"; }
if ($record['category'] == "CA") { print "Canada"; }
?>


Do you need to output that multiple times on your pages? Would that work?
Dave Edis - Senior Developer
interactivetools.com