Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2010-04-03 22:09:23

darock
Member
Registered: 2007-11-23
Posts: 54

creating fields with dropdown menu

i have client that needs to show off their tshirt products with various fields (ie; size, color) via a dropdown. Is there a way to allow them to input their product information on the backend so that it outputs dropdowns on the frontend? What plugins would be involved?

Here is a mockup screenshot of what we are trying to accomplish.

Last edited by darock (2010-04-03 22:10:52)

Offline

#2 2010-04-04 07:59:03

jstubbs
Member
From: Hong Kong
Registered: 2004-12-13
Posts: 2,395
Website

Re: creating fields with dropdown menu

Not sure if the tip fits, but you might take a look and see if you can add the custom field data to the select box.

Offline

#3 2010-04-04 10:15:49

jakob
Admin
From: Germany
Registered: 2005-01-20
Posts: 5,000
Website GitHub

Re: creating fields with dropdown menu

I’m not sure how you have your data stored in the back-end but if you are planning to custom fields, you can put information separated by commas or another delimiter into a custom field, e.g. a custom field named “colour” with white,grey,green and then iterate over the entries using smd_each or rah_repeat. You can use this to build select option drop-downs dynamically depending on available data.

That much is “easy”. The harder part will be working out how best you might go about pairing data, e.g. to get the picture to change if you change the colour or to give individual items different prices. Maybe for the picture, you name the images tee_green.jpg, tee_white.jpg and so on and make your drop-down trigger an image change based on the option-value that matches the name of the image (you couldn’t used txp’s own image panel for this, though, as txp renames images).

For pairing other information, one option might be to use several sets of delimiter-separated custom fields, e.g. a custom field named “type” with S,M,L,XL and another custom field named “price” with 5,10,15,25 (the number and dividers will need to match exactly) or maybe, just maybe with smd_each (which has depths I have yet to fully fathom) you can use delimiters within delimiters, e.g. a custom field named “variants” with S,5|M,10|L,15|XL,25… you’ll have to do some research there.


TXP Builders – finely-crafted code, design and txp

Offline

#4 2010-04-04 21:06:22

darock
Member
Registered: 2007-11-23
Posts: 54

Re: creating fields with dropdown menu

Thanks guys. Just to clarify, I only intend to have one image for each product. So we won’t have a need to have the image change based on the color that the end user selects or some complex pairing method you suggested. Thank God! The image will simply pop up via a lightbox effect if the user clicks on it.

I had a project some while ago where I used glz_custom_fields plugin to allow client to update information about each car they were selling. So I imagine I can use this plugin with either smd_each or rah_repeat.

Offline

#5 2010-04-05 05:24:58

darock
Member
Registered: 2007-11-23
Posts: 54

Re: creating fields with dropdown menu

On a side note, does anyone know of an outside script that allows for this sort of management of product uploads?

Offline

Board footer

Powered by FluxBB