Categories and Subcategories

13 posts by 6 authors in: Forums > CMS Builder
Last Post: June 21, 2010   (RSS)

By Perchpole - March 27, 2009

Hi, Chassa -

There are a number of ways you can employ the method I outlined above. The simple method is pretty straight forward...

1) Create a new multi-page Editor. For the sake of argument we'll call it "Categories". The only data you need to enter for each record is the Title. So, create a couple of records, naming each one after a specific category (news, articles, features, etc...).

2) Next, create another multi-page editor called "Content". This will hold all of the articles on the site. Modify the editor according to your needs adding all the necessary fields you are likely to use.

3) Whilst working on this editor you will need to add a "List" field. Call it "Category". Use the "Get options from database" option and the select your "Categories" table (created in step 1) and then choose the "Title" for both the option and value selectors.

4) Now, when you come to add your first article you'll have a drop-down menu called "Category". This will allow you to assign the name of a category to each article you create.

5) All you need to do now is set-up your list pages so that CMS will display your articles according to the categories. The easiest/quickest way of doing this is to create a list index page for each of your categories. Then add the ''where ' code to the top of each page using the following format...

'where' => "category = 'YOURCATEGORY'",




You can also show multiple categories on the same page...

'where' => "category = 'YOURCATEGORY' OR category = 'ANOTHERCATEGORY'",




There is a slightly more dynamic way you can achieve the same results but this is a good way to start and get an understanding of the method in practice.

Also, if you take a look at the following website you'll be able to see how it works on a large portal.

http://www.theassaultgroup.co.uk/

Here each article is assigned to a category and each category is assigned to a section. It takes a bit of working out but it does work and really completely dynamic.

The take a look at the gallery section for an example of creating dynamic index pages on the fly...

http://www.theassaultgroup.co.uk/gallery/gallery_index.php

Use the menus beneath the thumbnails to select the content.

:0)

Perch

Re: [studio-a] Categories and Subcategories

By Jason - June 21, 2010

Hi,

Just want to confirm that this issue was resolved via e-mail. If so, could you post the solution.

If not, just let me know and I'll take another look at it.

Thanks.
---------------------------------------------------
Jason Sauchuk - Project Manager
interactivetools.com

Hire me! Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/