Advertisement

How to Show "Tags" Column in Article Manager Backend

General questions relating to Joomla! 4.x.

Moderator: General Support Moderators

Forum rules
Forum Rules
Absolute Beginner's Guide to Joomla! <-- please read before posting.
Forum Post Assistant - If you are serious about wanting help, you should use this tool to help you post.
Windows Defender SmartScreen Issues <-- please read this if using Windows 10
Post Reply
katz123
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 118
Joined: Sun Feb 01, 2009 4:16 am

How to Show "Tags" Column in Article Manager Backend

Post by katz123 » Sun Oct 20, 2024 5:52 pm

Hello,

Hope this makes sense.

I would like to know if it is possible to show tags in the article manager. I know you can navigate and select a tag to see the associated articles - but I would like to know, at a glance, if I forgot to add a tag to an article.

I am using the most current J4.

Thank you.

Advertisement
User avatar
Pnkr
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 190
Joined: Thu Sep 01, 2011 7:26 am
Location: Athens, Greece

Re: How to Show "Tags" Column in Article Manager Backend

Post by Pnkr » Fri Oct 25, 2024 8:47 am

Unfortunately, no. There is no such functionality.
I think it would be a heavy load also to check for each article which tags it has and show them in a table where someone my have pagination of 50,100 or more articles.

katz123
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 118
Joined: Sun Feb 01, 2009 4:16 am

Re: How to Show "Tags" Column in Article Manager Backend

Post by katz123 » Fri Oct 25, 2024 3:32 pm

Ok, thank you.

filliphey
I've been banned!
Posts: 1
Joined: Thu Jan 12, 2023 9:59 am

Re: How to Show "Tags" Column in Article Manager Backend

Post by filliphey » Fri Dec 06, 2024 1:15 pm

katz123 wrote: Sun Oct 20, 2024 5:52 pm Hello,

Hope this makes sense.

I would like to know if it is possible to show tags in the article manager. I know you can navigate and select a tag to see the associated articles - but I would like to know, at a glance, if I forgot to add a tag to an article.

I am using the most current J4.

Thank you.
Hello,

Yes, it is possible to show tags in the Article Manager in Joomla 4 (J4). While the default setup does not display tags in the list view, you can modify the configuration or use a custom approach to include them.
Navigate to Content > Articles in the Joomla Administrator panel.
Click the Options button in the toolbar (found in the top-right corner).
Under the Articles tab, check if there’s a setting to enable the "Tags" column. Unfortunately, if this option isn’t available by default, proceed to Option 2.
If tags aren't shown by default, you can achieve this through a minor customization:

Locate the Article Manager Code:

Navigate to the backend files of your Joomla installation.
Look for the

Code: Select all

administrator/components/com_content/views/articles/tmpl/default.php file
.
Add a Column for Tags:

Edit the file and add a new column in the table that pulls the tags associated with each article.
Use the

Code: Select all

TagsHelper::getTags()
function to retrieve tags and display them in the new column.
Example code snippet for retrieving tags:

Code: Select all

$tags = TagsHelper::getTags($article->id, 'com_content.article');
echo implode(', ', $tags);
If you’re not comfortable editing code, you can use a third-party Joomla extension to manage tags more effectively. Look for extensions in the Joomla Extensions Directory (JED) that enhance the Article Manager's capabilities.

katz123
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 118
Joined: Sun Feb 01, 2009 4:16 am

Re: How to Show "Tags" Column in Article Manager Backend

Post by katz123 » Fri Dec 06, 2024 5:33 pm

Thank you - after com_content/ there is no "view" folder.

There is however, administrator/components/com_content/tmpl/articles - and a default.php under that folder - it looks to be the correct file but not positive.

Also this change would only be temporary until the next update.

I appreciate the feedback.

pixelhexe
Joomla! Apprentice
Joomla! Apprentice
Posts: 16
Joined: Fri Nov 24, 2006 1:31 pm

Re: How to Show "Tags" Column in Article Manager Backend

Post by pixelhexe » Thu Dec 12, 2024 11:47 pm

I had the same question for Joomla 5 and here is how I've found a solution. You'll have to copy
administrator/components/com_content/tmpl/articles/default.php
to
administrator/templates/atum/html/com_content/articles/default.php

With this override it won't change with the next update.

In this file you need to make some additions to extend the table with cells - one for the table head and one for the table body.

Start looking for

Code: Select all

use Joomla\Utilities\ArrayHelper;
and add

Code: Select all

use Joomla\CMS\Helper\TagsHelper;
Table head: I put my addition for tags after cell with the title and before cell with access level, so after

Code: Select all

<th scope="col" style="min-width:100px">
<?php echo HTMLHelper::_('searchtools.sort', 'JGLOBAL_TITLE', 'a.title', $listDirn, $listOrder); ?>
</th>
I added:

Code: Select all

<th scope="col" style="min-width:100px">Tags</th>
I do it without sort option because it is sufficient for my purposes.

Table body: Before the cell with access level

Code: Select all

<td class="small d-none d-md-table-cell">...
I added this code to show one or more tags in the additional cell or column:

Code: Select all

 <td class="small d-none d-md-table-cell">
<?php
	$item->tags = new TagsHelper();
        $trainers = $item->tags->getItemTags('com_content.article', $item->id);
        foreach ($trainers  as  $trainer) {
                     echo $trainer->title;
          }
 ?>
</td>
That did the trick for me. Of course you can adapt the variable name "$trainers" for your purposes. Good luck. :)

Advertisement

Post Reply

Return to “General Questions/New to Joomla! 4.x”