Home | Products | Consulting | Forums | Support | Order | 1-800-752-0455
  Main
Index
Search
Posts
Who's
Online
Log
In

Home: Products: CMS Builder:
List Options

 

 


gethudson
Novice

May 20, 2008, 3:57 AM

Post #1 of 4 (282 views)
Shortcut
List Options Can't Post

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


Dave
Staff / Moderator


May 20, 2008, 10:02 AM

Post #2 of 4 (272 views)
Shortcut
Re: [gethudson] List Options [In reply to] Can't Post

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


Perchpole
User

May 24, 2008, 2:04 PM

Post #3 of 4 (229 views)
Shortcut
Re: [Dave] List Options [In reply to] Can't Post

Hi, Dave -

I've just used this technique as a category selector when creating a products on my site. I can then split up the products by means of the $options['where'] condition - which is really smart.

Just one question...

Is there any way I can call the label - not code - when inserting the record on a page?

If I use <?php echo $record['category']; ?> for example, it will return the code. Could I tweak it to return the label? (which would be useful as a Category heading)

:o)

Perchpole

PS. Yes, I do want to have my cake - and eat it?


Dave
Staff / Moderator


May 24, 2008, 2:56 PM

Post #4 of 4 (226 views)
Shortcut
Re: [Perchpole] List Options [In reply to] Can't Post

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:


Code
<?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

 
 
 


Search for (options)
Products
CMS Builder
Article Manager
Realty Manager
Listings Manager
Order Now
Services
Priority Consulting
Support
Online Documentation
Support Forums
Support Homepage
Company Info
12 reasons to choose us!
Meet the team
Monthly newsletter
Contact Us
Toll Free: 1-800-752-0455
Phone: (604) 689-3347
Sales | Support
Conditions of Use | Privacy Policy | Copyright © interactivetools.com 2008
#201 - 2730 Commercial Drive, Vancouver BC Canada V5N 5P4