Joomla Tags – How to limit number of tags show in article?

0
Joomla Tags – How to limit number of tags show in article?
Rate this post

By default, Joomla will show all tags of an articles. So, if you create many tags, or you just want to limit the number of tags to show up to 10 or less, how can you do that?
Well, after using a hour to google and find nothing, Bien Thuy open the view file and study how Joomla render the tags show.
Take a look at this code:

It mean if we allow to show tags and we have tags in our articles, it will render and show all the tags.
Now, we know the tags show is an arrray at $this->item->tags->itemTags
It show an Object for each, then we can easy filter it and show first x tags we want to show. (x is number of tags we want to show up)

Then the final code will look like:

 

Last update: 02:54:38 AM, 23rd December 2017
Share.

About Author

Leave A Reply