There was a question in the forum today about, if I understand the question correctly, how to use Taxonomy Terms to navigate a site and find content using Backdrop CMS.
(Here is a screencast of me working through the options in this blog post).
This is the kind of thing that Backdrop CMS does quite well, but as usual there is no single solution to the problem and multiple approaches are possible. I'd like to describe what I consider to be the straightforward solution to this problem, but will also hints at a few other alternatives.
Create your "Category" Vocabulary
- Go to admin/structure/taxonomy and create a new vocabulary called "Category."
- Enter a few sample categories as terms.
Create Content Type and Add Term Reference Field
- Create your custom content types, we've created one called Stories. (NOTE: Everything described here can be accomplished with ANY content type).
- If you need help with creating new content types, here are some resources: Video or User Guide Page.
- If you need help with creating new content types, here are some resources: Video or User Guide Page.
- Add a Term Reference Field that references the "Categories" vocabulary.
- Set the maximum number of categories that you would like added to each piece of content (node).
- Use the Devel module to create some sample content (or enter your own content).
- Already, you will find that on each Story that you create and assigned a category, that it is possible to click on the category assigned to that piece of content and be taken to a listing of all other content with that category.
Create a Taxonomy Menu
Backdrop CMS comes with some fine menu options and tools right out of the box. However, to automatically generate a menu based upon any given taxonomy, you will likely need a contributed module.
- Download and install the Taxonomy Menu module.
- Add a menu called "Categories" without any sub-menu items (yet) - admin/structure/menu
- Configure the Taxonomy Menu settings for the "Categories" vocabulary - admin/structure/taxonomy/categories/configure
- Place a Categories menu block the default layout in the right sidebar.
- Set the visibility path for the menu block to only show it on Story pages.
You should now have a menu of categories that shows up on any story page or any category page. The image below is a Story page with a list of available Categories in the right column. The link for each Category will lead to a page that shows all content of that Category.
Using a Tag Cloud (Tagadelic module)
Backdrop CMS also has the Tagadelic module available which will create a tag cloud out of all your Categories with the most frequently used category showing up at a larger size. The following screenshot shows the same page using Tagadelic instead of Taxonomy Menu. In both cases, you would find and place the block in the same way and with the same visibility conditions.
The configuration page for Tagadelic (admin/config/content/tagadelic) provides the opportunity to change the sort order of the tags (categories), decide how many will show up in the cloud, and set the size differential between the smallest and the largest tags. If you set this to "1", all the tags will be the same size.
Using Views and Exposed Filter
The final option that we will look at today is to use the views module.
- Create a view of your Stories with an exposed filter.
Here is how to configure the filter:
- You can then place the exposed filter on the layout in the same manner as in the previous examples, with the same visibility conditions. The results will look something like this:
Add comment