close ad
WARNING: Do Not Install the DREAMWEAVER CC 2017 or 2018 Update »
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

sub category section

Thread began 11/10/2015 11:16 am by Jamie | Last modified 11/12/2015 1:50 pm by Ray Borduin | 655 views | 6 replies |

Jamie

sub category section

Hi Ray

Have got a new site where I have a main categories (covered by productcategories in the db) which can then have sub categories within each main cat - I need to set it up so that the client is able to add/remove sub cats and link to the parent main category.

I then need to set it so that the client is able to select the main/sub category for each product

My current tables set up in the db are products, productcategories and productmanufacturers so guess I need to add productsubcategories and structure the columns for the new one with similar columns to productcategories...

Just not sure, that being the case, how I then go about linking the new one and the relaional aspects

Any suggestions please mate?

Cheers

Jamie

Sign in to reply to this post

Ray BorduinWebAssist

I usually use the same categories table for subcategories and then just add a CategoryParentID field to point to the parent category.

Then you can use 0 as the parent for the main categories and the ID of the category for any sub categories. When inserting a sub category just add a select list to the page that selects all categories with parent = 0 and insert that selected value into the CategoryParentID field.

Sign in to reply to this post

Jamie

Thanks Ray... sorry but dont really understand

"Then you can use 0 as the parent for the main categories and the ID of the category for any sub categories."

Have copued the productcategories table and names it productsubcategories. Have added CategoryParentID to the new productsubcategories table but not sure what I need to do now...

Sign in to reply to this post

Ray BorduinWebAssist

Now you can start adding subcategories. For the main categories that you already have, make sure the CategoryParentID is set to 0.

Then when adding a sub-category, set the value of that field to match the CategoryID of the parent category.

Sign in to reply to this post

Jamie

so I need a CategoryParentID in both tables not just the sub one?

Sign in to reply to this post

Ray BorduinWebAssist

I'm saying only use one table... no need for both a category and sub-category table with this technique. Sub categories are still categories, just with a parent category defined.

Sign in to reply to this post

Jamie

ahh gotcha... thanks will have a crack at that tomorrow

Sign in to reply to this post

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...