multiple pulldown label names in editor?

4 posts by 2 authors in: Forums > CMS Builder
Last Post: September 24, 2012   (RSS)

By (Deleted User) - September 21, 2012

Hi, I am trying to make the list field more readable for the client when he is entering related products.

The trouble occurs when there is a family of products for example called redbear. there may be a redbear bed, redbear chair etc. Currently when populating the products table they have to add a product name(redbear) and choose a category (bed)

Using a pulldown list (multi) The related products currently show just the Product Name.

Is it possible to have more than one value for the label?.

for example
Option Label : Product Name - Product Category
Option Value : Product Name

so the client would see on the dropdown box - redbear - bed

Hope someone can help

Re: [g_williams] multiple pulldown label names in editor?

By gregThomas - September 21, 2012

Hi,

Are both the product name and category stored in the same table? If they are you might be able to list them by selecting Get options from MySQL query from the list options and then using a SELECT statement similar to the one below:

SELECT num, CONCAT(product_category, " - ", product_name)
FROM `<?php echo $TABLE_PREFIX ?>product_table`


You will need to change the variables so that they match what you have used in your tables.

This won't work if the table is storing the product category using its num field. But I can suggest something else if that is what is being used.

Thanks!

Greg
Greg Thomas

PHP Programmer - interactivetools.com

Re: [g_williams] multiple pulldown label names in editor?

By gregThomas - September 24, 2012

Hi,

I've done a quick test and you should be able to use the following to make the stored value the product_name:
SELECT product_name, CONCAT(product_category, " - ", product_name)
FROM `<?php echo $TABLE_PREFIX ?>product_table`


Let me know if this doesn't work for you.

Thanks

Greg
Greg Thomas

PHP Programmer - interactivetools.com