I'm creating a mega menu for a clothing e-commerce site. The categories are split between New In, Women and Men. New In will just be links straight to particular products but I want the Women and Men categories to be linked to the relevant categories via just two pages. So underneath the Women category will be skirts and tops for example.

I don't know if I'm going about this the right way or what way to approach it. Obviously the bit where the comment is would be where I would enter each category. Although I'm not sure what would go here.

Another way would be to store the categories in the database (which you probably do anyways) and define which category belongs to men and women. Then you could only use a single category id to navigate.

Hi Martin, what would go in the '//content' area. Would it be the URL?
–
JonahOct 4 '12 at 10:27

Well I thought you got URLs from the eshop system like in your question. You must work with what you got after all. The case just contains the queries or whatever you do process after you know which case you are working with (for example woman skirts).
–
Martin MüllerOct 4 '12 at 10:29

Right ok, so the URL should go in there? Sorry, as I mentioned, I've never used switch before.
–
JonahOct 4 '12 at 10:32

if you want to redirect via the url then you should generate it there, yes. switch is just a better way to have less code when dealing with many options. you could rewrite each switch into many if/elseif statements.
–
Martin MüllerOct 4 '12 at 10:42