How to Create Layout Overrides for Joomla Tags

How to Create Layout Overrides for Joomla Tags

Joomla allows you to customize almost any feature through overrides.

Layout overrides are a type of override that enable you to customize small elements such as the article author or published date.

In this tutorial, I'll show you how to create a layout override for Joomla tags.

The image below shows how tags look by default in Joomla articles, using the Protostar template:

Joomla tags in Protostar template

These tags are active links. In this example, I want to keep the tags but remove the links.


Step #1. Create a layout override

Let's copy some files from the Joomla core into our template, so we can customize them safely.

  1. Go to Extensions
  2. Templates
  3. Templates
  4. Find your template details & files

Finding your Joomla template in the administrator

  • Click the "Create Overrides" tab.
  • Click on "content" in the Layouts column

your Joomla template files in the administrator

This will generate a set of files in the /templates/your-template/html/layouts/joomla/content/ folder.


Step #2. Customize the tags layout

  • Go back to the "Editor" tab
  • Navigate to html > layouts > joomla > content > tags.php

4

Here you can change the code that renders the tags displayed on articles.

In this example, I want to remove the links and just leave the labels; you can change the code depending to your needs.

In lines 24 and 26, I switch the opening and closing <a> elements, and replace them with <span>.

Modifying tags.php in Joomla

This is how the code will look after my small change:

Updated version of tags.php

  • Click "Save & Close" when you're done.

Step #3. End result

Visit one of your articles on front-end and see how the tags are still there, but are no longer links.

Joomla tags with no links


Learn more

Want to find out more about Joomla overrides. There are video classes about overrides in Joomlashack University.

You can also see examples of overrides in the Wright Framework, and our Joomla templates.


About the author

Valentín creates beautiful designs from amongst the tequila plants of Jalisco, Mexico. You can see Valentín's design work all over this site and you can often find him helping members in support.