Now that we have some pathfinder articles and I've learned a little bit more it's time to have a proper look at categories.

Plan

Having a plan is good. Even if it's only useful at the end of project for taking the pish out of the author for how badly they had misunderstood things at the start. In this case I sat down with a blank page in Impress and seriously started to think about the structure for a first good go at this site. Spoiler: It lasted less than 2 weeks.

Plan for categories and menus

 

Joomla! categories form a tree or taxonomy (this is getting dangerously close to a previous work life) with the top levels being general categories and then at each level down you get more specific. And we can have a similar thing with Menus where one approach is to group things by function under common headings (interface design is also something of a previous life before it got pretentious and started calling itself UX).

So I figured that at least some of the Categories and Menus would overlap leading to a plan with a top level menu L1 consisting of tabs for Home, Blog, Tech Life, Cloud Life and About.

Articles would be classified as Blog, Tech Life or more likely a sub-category of Tech Life, Cloud Life or again more likely a sub-categroy of that. Articles used for site layout such as the About page, Home page or maybe introductions to the L1 pages would be categorised as Layout. Uncategorised is retained for anything else that might crop up.

Of course if I was presenting this professionally it would have employer logos on it and be made to look pretty. It would also be slightly worrying since this is not what I should be doing as my day job, but as promised this is an as-it-happened working account so you get to see working documents. This might also suggest some other topics that may appear, but I make no promises apart from two others are pretty much done, two more are stable with plans to build on and one has driven me close to despair with a semi-related issue that's turned into a showstopper. And I'm not giving any commitments as to when I'll get to write any of them up.

First Categories

The hard part is deciding a starting set of categories. Setting them up in Joomla! is quite easy.

Official Joomla! 4 Documentation:  https://docs.joomla.org/J4.x:Getting_Started:_Adding_a_Category

Starting from an Administrative login navigate to Content > Categories

Categories menu

In a new installation there will only be a single entry in the list: Uncategorised. Starting our first new category, Blog, click on the New button to bring up a very similar editor screen as used for articles.

Add Blog category

Title holds the category name, in this case "Blog"

Description is used to provide a bit more detail and to start with I just added a brief description of "General blog entries". It can be used to much greater effect if you need and that is covered in a later article.

When you're ready click Save & Close.

Open the front-end (the button in the top-right corner with your site name on it) and click on PoC, which we configured in Content: First Posts to show "List all categories in an article tree" to see our new Blog category.

Blog category not shown

And we see... no blog category. This is not quite as expected.

We need to go to the configuration of the PoC menu on our backend browser window ( Menus > Main Menu > PoC ) and then to the Category tab which is set to Global (Hide) by default. Change this to Show.

Show empty categories setting

Click Save and then switch to your frontend browser window and click refresh.

Blog category listed

Now we can see our Blog category, and underneath it's also showing the description too.

Don't worry about how this looks right now. Not only are we still working on our Dev system so nobody else can see this, but this is the PoC menu which is where we try things out.

Simply repeat the process for the rest of our top-level categories.

L1 category list

The Cloud Life category is one I'm not so sure about right now so I set that to Registered and also Unpublished untill I'm ready to use it (or delete). As mentioned in the plan, the Layout category is to hold structural articles such as the Home and About pages so this was also set to Unpublished for now.

The next step is to build up the L2 sub-categories for Tech Life by creating more categories in exactly the same way, except this time we set the Parent field to the Tech Life.

Create sub-category for Joomla

Again I've given it a brief description as well. When ready click Save & Close.

Repeat this process for the rest of the L2 categories: Geeklab, PostCot, Samba DC and Nextcloud, each time making sure to set Parent to Tech Life.

L2 categories for Tech Life

So now we have the complete set of Categories set up and ready. Or at least, we have version 1 set up as I'll be very surprised if this survives until launch. [Spoiler: it didn't...]

Now will be a good time to go back to all the articles I've already started and assign them to the correct category, which at this time are all about this Joomla implementation.

Update article category

Go to Content > Articles and for each article in turn click on it to open then click on the Category field and pick the new one from the list. Sub-categories are listed under their parent prefixed with a dash, in this case - Joomla.  This is also why you want to get your categories decided early on as updating 100's articles later does not sound like a fun task. Once you're picked the updated category for each one click Save & Close and move on to the next.

If you go back to the Content > Categories list you'll now see a list of the categories and the number of articles in each category broken down by status. At this point I had four Joomla articles published, and two more being worked on.

Joomla category with article count

Switching to the frontend browser windows, click onto the PoC menu we now have a single entry for Tech Life with 0 articles although it has sprouted a + on the right side of the screen, which is a bit misleading if you ask me but this just the default layout.

Subcategories hidden by default

If you click on the + the Joomla sub-category will be revealed, which probably makes sense if you have lots of sub-categories.

Sub-categories revealed

If you click on Tech Life itself then all of it's sub-categories will also be revealed, including all the empty ones. The way articles and sub-categories are displayed are controlled by the settings of the menu item, and that's a separate topic.

Recap

Categories are at the heart of the Joomla! Content Management System, and every article has to be assigned to a category.

We've seen how categories form a hierarchy or taxonomy and that we have complete control over this, and there can be an overlap between categories and menus. You can of course change your category structure at any time, adding new ones or moving them to appear under a different parent.

I hope you can also understand that you really want to get your category structure sorted out as soon as you can to avoid the effort of reworking it later.

While the examples so far have been very simple, we've explored the key issues and I'm sure this will be revisited.

 

Boot Note:

By the time the site went live some of the detail on this page such as category names changed, and the top level was also restructured so I could hide the layout articles. But the process for setting up categories and sub-categories is still good, and the changes and reasoning behind it are in a later article.