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: [greg] multiple pulldown label names in editor?

By (Deleted User) - September 24, 2012

Hi Greg, that works great.
Both product name and category shows in drop down.

Is there away to change the value from num to product name? I am trying to make SEO URL friendly titles.

I did try changing to SELECT product_name?

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