Yesterday, I was having some fun testing PyroCMS, when I stumbled upon something ‘annoying’ with the blog module. The blog module allows you to create categories (in a flat structure) but there’s no option to link to just a specific category.
Or so I thought, until I stumbled upon the documentation, that mentioned the URL structure for the blog module. Unlike Joomla! PyroCMS generates these URL’s regardless of whether you created a menu item or not. This allows you to easily link to a single category from within the menu.
The best part? You don’t need to code anything.
Here is how it’s done.
First off, you will need the ‘slug’ for your category.
- Go to Content > Blog
- You will see a list of categories. Click “Edit” next to the category you want to link to.
- In the next screen, take a note of (or copy) the info in the “Slug” box. You will need this later on.
- Go to Structure > Navigation
- Click on “Add Link” to create a new Menu Item (You can do this in any of the available menu’s)
- For the new item, choose “Site Link” as the link type.
- In the site Link box, add the following: blog/<Your Category Slug>. For example, if your category slug was news-and-updates, type “blog/news-and-updates” in this box.
- Click Save
- Now, if you visit your front page you’ll see that you’ve got a menu item which is pointing to a single Category only, without having to change any code.