Skip to main content
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
added 4869 characters in body
Source Link
dg82
  • 1
  • 2

This the layout for *._items.php:

authorise('core.edit', 'com_tags');$canCreate = $user->authorise('core.create', 'com_tags');$canEditState = $user->authorise('core.edit.state', 'com_tags');$n = count($this->items);?>
<div class="accordion" id="accordionTags">
    <?php if ($this->items == false || $n === 0) : ?>
        <p><?php echo JText::_('COM_TAGS_NO_TAGS'); ?></p>
    <?php else : ?>
        <?php foreach ($this->items as $i => $item) : ?>
            <?php if ((!empty($item->access)) && in_array($item->access, $this->user->getAuthorisedViewLevels())) : ?>
            <!--Card Start -->
            <div class="card">
                <!-- Row Heading -->
                <div id="tagRowHeading-<?php echo $i;?>" class="card-header cat-list-row<?php echo $i % 2; ?>">
                    <h4>
                        <button class="btn-btn-link" type="button" data-toggle="collapse" data-target="#collapseCard-<?php echo $i;?>" data-parent="#accordionTags" aria-expanded="false" aria-controls="collapseCard-<?php echo $i;?>">
                                <?php echo $this->escape($item->title); ?>  
                        </button> 
                    </h4>
                </div>
                <!-- End Card Heading -->
                <!-- Card Body -->
                <div id="collapseCard-<?php echo $i;?>" class="collapse" aria-labelledby="tagRowHeading-<?php echo $i;?>" data-parent="#accordionTags">
                    <div class="card-body">
                        <?php echo $this->loadTemplate('items_tag'); ?>                     
                    </div>
                </div>
                <!-- End Card Body -->
            </div>
            <!-- End card -->   
            <?php endif; ?>
            <div class="caption">
                <?php if ($this->params->get('all_tags_show_tag_description', 1)) : ?>
                    <span class="tag-body">
                        <?php echo JHtml::_('string.truncate', $item->description, $this->params->get('all_tags_tag_maximum_characters')); ?>
                    </span>
                <?php endif; ?>
            </div>
        <?php endforeach; ?>
    <?php endif; ?>
    <?php // Add pagination links ?>
    <?php if (!empty($this->items)) : ?>
        <?php if (($this->params->def('show_pagination', 2) == 1 || ($this->params->get('show_pagination') == 2)) && ($this->pagination->pagesTotal > 1)) : ?>
            <div class="pagination">
                <?php if ($this->params->def('show_pagination_results', 1)) : ?>
                    <p class="counter pull-right">
                        <?php echo $this->pagination->getPagesCounter(); ?>
                    </p>
                <?php endif; ?>
                <?php echo $this->pagination->getPagesLinks(); ?>
            </div>
        <?php endif; ?>
    <?php endif; ?>
</div>

And for the list of articles(loadTemplate('items_tag')):

    <?php
    defined('_JEXEC') or die;

JHtml::_('behavior.core');
JHtml::_('formbehavior.chosen', 'select');

$n         = count($this->items);
$listOrder = $this->escape($this->state->get('list.ordering'));
$listDirn  = $this->escape($this->state->get('list.direction'));

$articleTag = new JHelperTags;
$articleTag->getItemTags('com.content.article', $item->id);

JFactory::getDocument()->addScriptDeclaration("
        var resetFilter = function() {
        document.getElementById('filter-search').value = '';
    }
");

?>
<div id=tagtest>
    <?php echo JLayoutHelper::render('joomla.content.tags', $articleTag->itemTags); ?>
</div>

<ul>
    <?php foreach ($this->items as $i => $item) : ?>
        <?php if ($this->items[$i]->core_state == 0) : ?>
            <li class="system-unpublished cat-list-row<?php echo $i % 2; ?>">
        <?php else : ?>
            <li class="cat-list-row<?php echo $i % 2; ?>">
        <?php endif; ?>
                <a href="<?php echo JRoute::_(TagsHelperRoute::getItemRoute($item->content_item_id, $item->core_alias, $item->core_catid, $item->core_language, $item->type_alias, $item->router)); ?>">
                        <?php echo $this->escape($item->core_title); ?>
                    </a>
                    <?php if ($item->core_state == 0) : ?>
                        <span class="list-published label label-warning">
                            <?php echo JText::_('JUNPUBLISHED'); ?>
                        </span>
                    <?php endif; ?> -->
            </li>
    <?php endforeach; ?>
</ul>

This the layout for *._items.php:

authorise('core.edit', 'com_tags');$canCreate = $user->authorise('core.create', 'com_tags');$canEditState = $user->authorise('core.edit.state', 'com_tags');$n = count($this->items);?>
<div class="accordion" id="accordionTags">
    <?php if ($this->items == false || $n === 0) : ?>
        <p><?php echo JText::_('COM_TAGS_NO_TAGS'); ?></p>
    <?php else : ?>
        <?php foreach ($this->items as $i => $item) : ?>
            <?php if ((!empty($item->access)) && in_array($item->access, $this->user->getAuthorisedViewLevels())) : ?>
            <!--Card Start -->
            <div class="card">
                <!-- Row Heading -->
                <div id="tagRowHeading-<?php echo $i;?>" class="card-header cat-list-row<?php echo $i % 2; ?>">
                    <h4>
                        <button class="btn-btn-link" type="button" data-toggle="collapse" data-target="#collapseCard-<?php echo $i;?>" data-parent="#accordionTags" aria-expanded="false" aria-controls="collapseCard-<?php echo $i;?>">
                                <?php echo $this->escape($item->title); ?>  
                        </button> 
                    </h4>
                </div>
                <!-- End Card Heading -->
                <!-- Card Body -->
                <div id="collapseCard-<?php echo $i;?>" class="collapse" aria-labelledby="tagRowHeading-<?php echo $i;?>" data-parent="#accordionTags">
                    <div class="card-body">
                        <?php echo $this->loadTemplate('items_tag'); ?>                     
                    </div>
                </div>
                <!-- End Card Body -->
            </div>
            <!-- End card -->   
            <?php endif; ?>
            <div class="caption">
                <?php if ($this->params->get('all_tags_show_tag_description', 1)) : ?>
                    <span class="tag-body">
                        <?php echo JHtml::_('string.truncate', $item->description, $this->params->get('all_tags_tag_maximum_characters')); ?>
                    </span>
                <?php endif; ?>
            </div>
        <?php endforeach; ?>
    <?php endif; ?>
    <?php // Add pagination links ?>
    <?php if (!empty($this->items)) : ?>
        <?php if (($this->params->def('show_pagination', 2) == 1 || ($this->params->get('show_pagination') == 2)) && ($this->pagination->pagesTotal > 1)) : ?>
            <div class="pagination">
                <?php if ($this->params->def('show_pagination_results', 1)) : ?>
                    <p class="counter pull-right">
                        <?php echo $this->pagination->getPagesCounter(); ?>
                    </p>
                <?php endif; ?>
                <?php echo $this->pagination->getPagesLinks(); ?>
            </div>
        <?php endif; ?>
    <?php endif; ?>
</div>

And for the list of articles(loadTemplate('items_tag')):

    <?php
    defined('_JEXEC') or die;

JHtml::_('behavior.core');
JHtml::_('formbehavior.chosen', 'select');

$n         = count($this->items);
$listOrder = $this->escape($this->state->get('list.ordering'));
$listDirn  = $this->escape($this->state->get('list.direction'));

$articleTag = new JHelperTags;
$articleTag->getItemTags('com.content.article', $item->id);

JFactory::getDocument()->addScriptDeclaration("
        var resetFilter = function() {
        document.getElementById('filter-search').value = '';
    }
");

?>
<div id=tagtest>
    <?php echo JLayoutHelper::render('joomla.content.tags', $articleTag->itemTags); ?>
</div>

<ul>
    <?php foreach ($this->items as $i => $item) : ?>
        <?php if ($this->items[$i]->core_state == 0) : ?>
            <li class="system-unpublished cat-list-row<?php echo $i % 2; ?>">
        <?php else : ?>
            <li class="cat-list-row<?php echo $i % 2; ?>">
        <?php endif; ?>
                <a href="<?php echo JRoute::_(TagsHelperRoute::getItemRoute($item->content_item_id, $item->core_alias, $item->core_catid, $item->core_language, $item->type_alias, $item->router)); ?>">
                        <?php echo $this->escape($item->core_title); ?>
                    </a>
                    <?php if ($item->core_state == 0) : ?>
                        <span class="list-published label label-warning">
                            <?php echo JText::_('JUNPUBLISHED'); ?>
                        </span>
                    <?php endif; ?> -->
            </li>
    <?php endforeach; ?>
</ul>
Source Link
dg82
  • 1
  • 2

Override List of all tags

I'm working on a override for com_tags List of all Tags, i want to change when clicking on the tag title the list of items (articles) will slide (accordion) instead of open in a new page. I create all the css and layout but i can't get the list for each tag. Tag list override Accordion