In my main navigation I want a dropdown menu for ‘Products’. The products are divided into categories and subcategories. I only want to show the parent categories in the navigation. I guess I can do this by specifically listing the parent category ID’s.
Actually, there’s a “parent_only” parameter when displaying your categories, so you should be able to use this to limit them.
Clicking on one of the parent categories links to its respective category page. On each category page, I want a list of that category’s children in the sidebar.
Nested categories are a bit tricky in EE sometimes, but you can accomplish this various ways, including using some great category-related add-ons available from devot-ee.com. First order of business would be to be able to display the set of categories you want within a nested unordered list showing all categories.
Rolling over the sub-categories should generate a fly-out menu showing the entries associated with that sub-category. This menu needs to be generated automatically based on the parent category for that page. I’ve looked at the Channel Category Archive Tag, but it doesn’t seem to be quite the right solution.
Once you have your main list of categories with children nested within your unordered list, the stylistic approach is then a matter of CSS and possibly jquery, so not something handled by EE but by code you “wrap around” your categories list.
And lastly, I haven’t been able to find whether categories can have the same name. So for example, can I have a category called ‘DVD’ with sub-categories of ‘Comedy’, ‘Drama’ etc. and then a category of ‘Blu-Ray’ with the same sub-categories of ‘Comedy’, ‘Drama’ ?
Yeah, here’s where you would run into some issues - EE does require category url titles to be unique - not the “name” just the URL title. So you can get around this by simply actively controlling your category url titles. And that’s because EE uses the category url title to determine what entries to show. There are ways around this - namely NOT using the actual category functionality and instead using an entries loop with a category condition that is fed by a segment-based lookup of the category ID (I’ve done this before to provide the kind of recursive parent-child relationship you are looking for and avoid the conflict of categories with the same name). That starts to get a bit complicated though and does rely on a few add-ons to make it happen. If you can instead add a parent category prefix to the subcategory URL title, you’d probably get around it ok.
Hope that helps. Cheers.