Re: select menus & database design

This WebDNA talk-list message is from

1998


It keeps the original formatting.
numero = 17806
interpreted = N
texte = >>We have a database of products for sale which is working fine. Some (not >>all) of the products come in different sizes and colors. At this point, >>they are all in our database as separate products. e.g., an extra-large >>teal backpack is a different product than the medium maroon backpack. >> >>With just a few options for each product, this isn't so bad. But with 6 >>colors and 4 sizes for many products, our product list is getting >>absurdly long, and not particularly user-friendly to navigate. >> >>What we'd like is for our search results template to recognize when a >>product has size and color options, and to generate a menu >>which shows the appropriate options. >> >>What would be a good database/template design to create such a feature?One way to do it is to make sure your product ID numbers (SKU's) are designed to hold different option values for your products. For example, use the first 7 characters for the unique identifier for each item, use the next two characters for the size (putting 00 in this place when there's no size options), use the next two characters for the color (putting 00 in this place when there's no color options), etc.Then when you want to create a popup menu, design a search that selects only the specific items which apply to that particular popup, while leaving other options off that popup menu.Another way to go is simply to add a few extra fields, one for color, one for size, etc., so you can search on those fields individually instead of trying to select the equivalent values from portions of the SKU. This solution is easier to deal with as far as WebDNA coding is concerned because it's always easier to search on a different field than to search on a portion of the same field. So if your database isn't all that big anyways, I would do it this easy way, but if you're concerned about the size of your database then I would use the first suggestion.One other thing I would suggest is to write the WebDNA code that creates your popups so that it creates include files -- instead of creating the popup code directly on the form pages themselves. Then use [include] to add those popups to your forms. That's only the first step, the next step is to put the code that creates your popups into a DailyTasks.tpl file that's requested once a day -- or in an [include] file that's only included once a day -- so WebCat doesn't have to create those popups more than once a day. This will make your forms appear faster on-screen, and it will reduce the time WebCat needs to spend creating the popups for those forms ... :)Sincerely, Ken Grome 808-737-6499 WebDNA Solutions mailto:ken@webdna.net http://www.webdna.net Kenneth Grome

DOWNLOAD WEBDNA NOW!

Top Articles:

Talk List

The WebDNA community talk-list is the best place to get some help: several hundred extremely proficient programmers with an excellent knowledge of WebDNA and an excellent spirit will deliver all the tips and tricks you can imagine...

Related Readings:

WebCat2 several catalogs? (1997) 2.0.1 new commands and contexts (1997) textA (1998) Can you do this??? and other stuff (1997) Re:PCS Customer submissions ? (1997) creative use of webcatalog (1998) Possible Bug in 2.0b15.acgi (1997) FlushDatabase Suggestion (1998) Fun with dates (1997) Cancel Subscription (1996) RE: Help name our technology! (1997) New [math] variable not working... (2001) Separate SSL Server (1997) [WebDNA] WebDNA version 7 feature list? (2011) WebCat2b13MacPlugIn - [shownext method=post] ??? (1997) WebCatalog Hosting (1996) Time for a hard questions. (1997) Here we go again... (2006) FEW QUESTIONS (1997) Multiple Ad databases? (1997)