Jump to content

categories show as sub-menu items of a menu


adrianmak
 Share

Recommended Posts

A client requested for rebuilt following website.  http://www.eware.com.hk/web/

Existing website is built from custom made php cms. It is not developed from any of php based cms or framework.

I'm thinking of using processwire to rebuilt the website.

I have following questions

How to built a menu with sub-menu where submenu is one of catagories. Such that adding new catagory will shown up on the menu automatically. For instance, the News and event menu of current website. the submenu are catagories.

Link to comment
Share on other sites

How to built a menu with sub-menu where submenu is one of catagories. Such that adding new catagory will shown up on the menu automatically. For instance, the News and event menu of current website. the submenu are catagories.

+ Home

++ News & Events

+++ Company News

++++ Company News post 1

++++ Company News post 2

++++ …

+++ Product News

++++ Product News post 1

++++ …

+++ Events

++++ Event 1

++++ Event 2

++++ …

All of these would be pages in a PW environment, but they'd use different templates to distinguish between e.g. overview pages and single news post view. You can use the excellent MarkupSimpleNavigation module to create your navigation or handcode it.

I'm not sure what should keep you from doing this in PW. Maybe it's the term “categories”, which is a terminology PW doesn't use. That's because in PW everything is a page, at least technically (but of course you can have a page template called “category”).

Link to comment
Share on other sites

This is not a problem.

Forget the idea of categories as a separate thing for the moment - they are just pages.

So, for instance, you can have this structure:

Home

-- News

---- Politics

---- Religion

---- Coffee

And then under each of those you would have the actual posts.

The template for the posts would include a page field.

That page field would be set for a single selection and then the parent set as the News page.

On the input settings for the page field you would pick the input field type of your choice and then also enable being able to create a new page directly from the field.

When someone creates a post, they would be able to select a category or create a new one.

The drawback for this is that you could end up with thousands of categories if people go silly!

Also, if you want the category pages to have additional details about the category (and intro paragraph, icon, whatever) then you will have to go back and edit those pages.

But essentially, what you want to do is very easy indeed.

  • Like 1
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...