Quantcast
Channel: Joomla! Forum - community, help and support
Viewing all articles
Browse latest Browse all 1575

General Questions/New to Joomla! 4.x • Re: How to Show "Tags" Column in Article Manager Backend

$
0
0
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:

use Joomla\Utilities\ArrayHelper;
and add

Code:

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:

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

Code:

<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:

<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:

 <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. :)

Statistics: Posted by pixelhexe — Thu Dec 12, 2024 11:47 pm



Viewing all articles
Browse latest Browse all 1575

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>