1

I was hoping someone could help me. I've searched high and low for an answer for this one, and I haven't been able to find the exact answer (even within the forum).

How can I display the category name in the url in Joomla (v2.5). I have 2 categories in my site so far. For example, I have a category called Refrigeration. I created an article called test and put it under the Refrigeration category. But for some reason, it will only display in the URL as: www.something.com/test.html.
I would like it to display like this: www.something.com/refrigeration/test.html

I know you can create a hidden menu, using the category (such as "Refrigeration") as the parent, and placing the related articles underneath that category (ie - with "Refrigeration" as their parent). But this seems rather inefficient. I just really want to be able to separate my articles on the site into different categories, and have that category display in the url.

Or, is the only way to accomplish this to install an SEF extension?

Any help is greatly appreciated. Please let me know if I need to provide further information.

EPM
  • 171
  • 1
  • 5
  • 16

1 Answers1

5

The default Joomla SEF functions solely on the menus structure. It's hard to believe, but once you accept that Joomla Menu's aren't for actually "building menus" and more for build url / site structure, life will become a bit easier.

To do what you want, you can create the hidden menu for each category, and it should work without having to put each article as a menu item underneath in the hidden menu. However, it would be much easier to use a SEF component to handle it for you. There may be some lightweight plugins available, but I haven't seen one.

SEF components can be found here: http://extensions.joomla.org/extensions/site-management/sef

Don Gilbert
  • 740
  • 4
  • 11
  • Yeah, I was trying to find a good SEF component (free of course ;-), didn't have much luck. But I'll try again. Thanks! – EPM Mar 26 '13 at 16:46
  • and I am now finally starting to get the actual purpose of "menus" in Joomla as more of building a path of my site. Took me a bit. – EPM Mar 26 '13 at 16:54
  • Can you explain a little further what you mean by "create the hidden menu for each category without having to put each article underneath"? Are you saying that I should create 1 hidden main menu with all the subcategories added under main? Or am I supposed to create a hidden menu for each category? – EPM Mar 26 '13 at 16:58
  • 1
    I would create a new menu, let's call it "Categories Hidden", and then create a new menu item for each category that you have. Mirror your category structure in this menu. Then, when you add a new article to that category, it will be automatically added to that menu item. IIRC, Joomla SHOULD associate the links to that article with the new menu structure, and build the url accordingly. – Don Gilbert Mar 26 '13 at 17:00
  • fabulous! Let me give that a try. – EPM Mar 26 '13 at 17:05
  • does it matter what type I choose as menu item type? – EPM Mar 26 '13 at 17:08
  • also, should the parent item be Main for all of these categories, or no parent? I'm getting this error when I try to create the new menu item: "Save failed with the following error: A first level menu item alias cannot be 'refrigeration' because 'refrigeration' is a sub-folder of your joomla installation folder." – EPM Mar 26 '13 at 17:22
  • then again, that could be because I do indeed have a sub folder called refrigeration in my joomla directory, so I should remove that – EPM Mar 26 '13 at 17:29
  • Ya - you should remove that. :) – Don Gilbert Mar 26 '13 at 18:49
  • Also, to answer your other question, you should mirror your category structure in the hidden menu, and I think that will give you the desired outcome. – Don Gilbert Mar 26 '13 at 18:50
  • 1
    I had to make the category structure and then in any other "real" menus I had to make the menu items "menu item aliases" of the category structure menu items. Basically, create every menu twice. – ryanwinchester Oct 11 '13 at 17:25
  • 1
    @decker yes, that is the process I described. You can create the category structure in the hidden menu, and then the URL's will work just fine. But if you want them in your actual menu, you will need to create menu item aliases, as you ended up doing. – Don Gilbert Oct 14 '13 at 17:02