Using List values between records

9 posts by 5 authors in: Forums > CMS Builder
Last Post: February 27, 2011   (RSS)

By avrom - April 21, 2009

Hey Dave,

I'm using a list value in one of my tables to pull the values from another table. This is being done to select business categories.

table name: business_category
mysql_advanced
option values: num
option labesl: category

Now in the table that uses the pull down category its only displaying as the num value, but I want to be able to display the option label (not the option value). Is there a way to do this without having to call up both tables ? Make sense ?

Cheers
Avrom

Re: [virgodesign] Using List values between records

By ross - April 22, 2009

Hi Avrom

Thanks for posting!

Based on what you've described, the value for "category" should appear as each option in the pull down menu. Is that actually a name or is it a number. You can make the display value pull in any field from the other table you like so it should just be a matter of making sure you are using the correct field.

Perhaps you could post some screen shots of your admin area so I can see what you are seeing.

Thanks!
-----------------------------------------------------------
Cheers,
Ross Fairbairn - Consulting
consulting@interactivetools.com

Hire me! Save time by getting our experts to help with your project.
Template changes, advanced features, full integration, whatever you
need. Whether you need one hour or fifty, get it done fast with
Priority Consulting: http://www.interactivetools.com/consulting/

Re: [ross] Using List values between records

By avrom - April 22, 2009 - edited: April 22, 2009

Hey Ross,

Thanks for the reply. The value for "category" does indeed appear as each option in the pull down menu (picture attached). No problem there :))

But when I call the value up in a detail or list viewer I get the inetger value of "num" displaying instead of the "label" - using "accommodation" as an example.

<?php echo $business_profileRecord['category'] ?>

This displays the inetger "1" instead of its label "accommodation".

Cheers
Avrom

Re: [virgodesign] Using List values between records

By ross - April 23, 2009

Hi Avrom

That's odd. Could you send me FTP details through consulting@interactivetools.com? Also toss in a link to this forum thread :).

Thanks!
-----------------------------------------------------------
Cheers,
Ross Fairbairn - Consulting
consulting@interactivetools.com

Hire me! Save time by getting our experts to help with your project.
Template changes, advanced features, full integration, whatever you
need. Whether you need one hour or fifty, get it done fast with
Priority Consulting: http://www.interactivetools.com/consulting/

Re: [ross] Using List values between records

By avrom - April 23, 2009

Hey Ross,

Sure I'll send you the FTP details. I'm sure its something simple I have overlooked on my end or done incorrectly :))

The link is
http://www.saturnaisland.net/main2.php

but it should look like this
http://www.saturnaisland.net/main.php

Cheers and thanx
Avrom

Re: [ross] Using List values between records

By Kenny - December 31, 2010

Did this get solved because I now all of sudden have the same problem?

Kenny

Re: [sagentic] Using List values between records

By Jason - January 3, 2011

Hi Kenny,

Just to refresh, the problem you're encountering is when you're outputting a list value, you getting a number instead of the label? Is that right?

If you're using CMS Builder 2.04 or higher, you can use the label pseudo field like this:

<?php echo $record['category:label'];?>

Hope this helps.
---------------------------------------------------
Jason Sauchuk - Project Manager
interactivetools.com

Hire me! Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/

Re: [Jason] Using List values between records

By Rusty - February 27, 2011

Hi Kenny,

Just to refresh, the problem you're encountering is when you're outputting a list value, you getting a number instead of the label? Is that right?

If you're using CMS Builder 2.04 or higher, you can use the label pseudo field like this:

<?php echo $record['category:label'];?>

Hope this helps.



YAY THIS IS EXACTLY WHAT I WAS LOOKING FOR!!

I was trying to figure out how to echo the LABEL for a list field, instead of the actual value. In my case it's a height field, and although the value is in metric, I have the labels set to show both the metric amount and the standard amount. Absolutely simple and perfect. YAY!

Keyword spamming: display multi list drop down select value instead of label name unit
Rusty