Success

User tests: Successful: Unsuccessful:

avatar tejaschavan724
tejaschavan724
21 Oct 2026

Pull Request resolves #48611.

  • I read the Generative AI policy and my contribution is either not created with the help of AI or is compatible with the policy and GNU/GPL 2 or later.

Summary of Changes

In components/com_tags/tmpl/tags/default_items.php, the template determines when to open and close <ul> elements around tag items.

When tag_columns is set to 1 (or defaulted to 1), $bscolumns is 1. The conditions previously included $bscolumns === 1:

<?php if ($n === 1 || $i === 0 || $bscolumns === 1 || $i % $bscolumns === 0) : ?>
    <ul class="com-tags__category category list-group">
<?php endif; ?>

and

<?php if (($i === 0 && $n === 1) || $i === $n - 1 || $bscolumns === 1 || (($i + 1) % $bscolumns === 0)) : ?>
    </ul>
<?php endif; ?>

Because $bscolumns === 1 was evaluated on every iteration, and because $i % 1 === 0 and ($i + 1) % 1 === 0 are also true for every integer $i, the template opened and closed a new <ul> for every single tag item in single-column layouts. This produced invalid markup with multiple single-item lists instead of one continuous list group:

<ul class="com-tags__category category list-group">
    <li class="list-group-item list-group-item-action">...</li>
</ul>
<ul class="com-tags__category category list-group">
    <li class="list-group-item list-group-item-action">...</li>
</ul>

This PR adjusts the opening and closing conditions so that:

  • For single-column layouts ($bscolumns === 1), the <ul> opens only on the first item ($i === 0) and closes on the last item ($i === $n - 1), grouping all tags into a single <ul class="com-tags__category category list-group">.
  • For multi-column layouts ($bscolumns > 1), rows are split into <ul> containers every $bscolumns items as before:
    • Opening: <?php if ($i === 0 || ($bscolumns > 1 && $i % $bscolumns === 0)) : ?>
    • Closing: <?php if ($i === $n - 1 || ($bscolumns > 1 && ($i + 1) % $bscolumns === 0)) : ?>

Testing Instructions

  1. In the Administrator backend, create or edit a menu item of type Tags -> List All Tags.
  2. Under the Selection Options tab, ensure there are multiple tags to display.
  3. Under the Options tab, set Number of Columns to 1.
  4. Save the menu item and view it on the frontend.
  5. Inspect the HTML markup of the tags list.
  6. (Optional) Test with Number of Columns set to 2, 3, or 4 to ensure multi-column row splitting remains intact.

Actual result BEFORE applying this Pull Request

Every single tag item is wrapped in its own <ul class="com-tags__category category list-group">...</ul>:

<ul class="com-tags__category category list-group">
    <li class="list-group-item list-group-item-action">
        <h3 class="mb-0"><a href="...">Tag 1</a></h3>
    </li>
</ul>
<ul class="com-tags__category category list-group">
    <li class="list-group-item list-group-item-action">
        <h3 class="mb-0"><a href="...">Tag 2</a></h3>
    </li>
</ul>

This causes broken visual styling (disconnected list-group items with separate margins and borders) and poor accessibility (screen readers announce each tag as a list of 1 item).

Expected result AFTER applying this Pull Request

All tag items are rendered inside a single <ul class="com-tags__category category list-group"> element:

<ul class="com-tags__category category list-group">
    <li class="list-group-item list-group-item-action">
        <h3 class="mb-0"><a href="...">Tag 1</a></h3>
    </li>
    <li class="list-group-item list-group-item-action">
        <h3 class="mb-0"><a href="...">Tag 2</a></h3>
    </li>
</ul>

Link to documentations

Please select:

  • No documentation changes for guide.joomla.org needed
  • No documentation changes for manual.joomla.org needed
avatar tejaschavan724 tejaschavan724 - open - 21 Oct 2026
avatar tejaschavan724 tejaschavan724 - close - 22 Oct 2026

Add a Comment

Login with GitHub to post a comment