You can display the tags of an article with the
This shows the tags of article "Lions":
By default, the output will be generated through the Joomla layout for tags.
If you want to output unstyled simple links to the tags, you can use the
To output the tags as plain text - so not as links - you can use the
You can also set a specific separator to place between the tags, by using a
separator="..." attribute inside the data tag. For instance:
[tags separator=" - "]
You can also add
last-separator="..." to use a different separator in between the last 2 elements:
[tags separator=", " last-separator=" and "]
Custom Output for each Tag J4
For even more control over the output of Tags, you can use the Foreach Structure feature. This gives you the ability to fully control the output of each tag assigned to the article.
For example, you could use it to give a custom styling to each tag:
Furry Fluffy Fuzzy
The great thing about this feature is that it allows you to output any attribute attached to a Tag. This means that, instead of showing just the name of the Tags, you could output the teaser image of each tag by using
Read: Using the Foreach Structure to output Tags in a Custom Layout.
List of Data Tags
When using Tags as part of the Foreach Structure, for each tag you can of output its title via
[row:title], its alias via
[row:alias], the description text via
Here are the Data Types available for a Tag when using Tags as part of the Foreach Structure:
||Furry||The name/title of the tag, linked to the tag itself.|
||Furry||The name/title of the tag, as plain text without link.|
||4||The ID of the tag.|
||furry||The alias of the tag.|
||...||The description text of the tag.|
||/tag/furry/||The URL to the tag (you can also use
||Furry||Opening and closing tag to add a link to the tag (wraps the content with an
||The teaser image or full image attached to the tag.|
||/tag/furry/||The URL of the teaser image or full image attached to the tag|
|badge-blue||Any other data attached to the tag. It must match the columns or attribute names available in the database.|
Alternative Layout J4
Articles Anywhere also allows you to set a different PHP layout for the Tags.
The default layout used to render Tags is located at this path:
You can use this default file as your starting base, copy this file to
templates/[my template]/html/layouts/joomla/content/my-tags-layout.php, and edit the code to meet your needs.
Now, in the data tag, you can set to use the alternative layout by inserting the path to your file starting from the
layouts folder of your template. The subdirectories must be separated with dots: