move expand button to first line of a category

This commit is contained in:
chmst 2021-10-06 13:50:05 +02:00
parent 859fb5a2a0
commit e01ce0337d
1 changed files with 15 additions and 14 deletions

View File

@ -20,15 +20,27 @@ if ($this->maxLevelcat != 0 && count($this->items[$this->parent->id]) > 0) :
<?php foreach ($this->items[$this->parent->id] as $id => $item) : ?>
<?php if ($this->params->get('show_empty_categories_cat') || $item->numitems || count($item->getChildren())) : ?>
<div class="com-content-categories__item">
<div>
<div class="w-100">
<a href="<?php echo Route::_(RouteHelper::getCategoryRoute($item->id, $item->language)); ?>">
<?php echo $this->escape($item->title); ?></a>
<?php if ($this->params->get('show_cat_num_links_cat') == 1) :?>
<span class="badge bg-info">
<span class="badge bg-info ">
<?php echo Text::_('COM_WEBLINKS_NUM_ITEMS'); ?>&nbsp;
<?php echo $item->numitems; ?>
</span>
<?php endif; ?>
<?php if ($this->maxLevelcat > 1 && count($item->getChildren()) > 0) : ?>
<button
type="button"
id="category-btn-<?php echo $item->id; ?>"
data-category-id="<?php echo $item->id; ?>"
class="btn btn-secondary btn-sm float-end"
aria-expanded="false"
aria-label="<?php echo Text::_('JGLOBAL_EXPAND_CATEGORIES'); ?>"
>
<span class="icon-plus" aria-hidden="true"></span>
</button>
<?php endif; ?>
</div>
<?php if ($this->params->get('show_subcat_desc_cat') == 1 && !empty($item->description)) : ?>
@ -51,18 +63,7 @@ if ($this->maxLevelcat != 0 && count($this->items[$this->parent->id]) > 0) :
<img src="<?php echo htmlspecialchars($img->url, ENT_COMPAT, 'UTF-8'); ?>"<?php echo $alt; ?>>
<?php endif; ?>
<?php if ($this->maxLevelcat > 1 && count($item->getChildren()) > 0) : ?>
<button
type="button"
id="category-btn-<?php echo $item->id; ?>"
data-category-id="<?php echo $item->id; ?>"
class="btn btn-secondary btn-sm float-end"
aria-expanded="false"
aria-label="<?php echo Text::_('JGLOBAL_EXPAND_CATEGORIES'); ?>"
>
<span class="icon-plus" aria-hidden="true"></span>
</button>
<?php endif; ?>
<?php if ($this->maxLevelcat > 1 && count($item->getChildren()) > 0) : ?>
<div class="com-content-categories__children" id="category-<?php echo $item->id; ?>" hidden>
<?php