Skip to content

Commit

Permalink
move expand button to first line of a category
Browse files Browse the repository at this point in the history
  • Loading branch information
chmst committed Oct 6, 2021
1 parent 859fb5a commit e01ce03
Showing 1 changed file with 15 additions and 14 deletions.
29 changes: 15 additions & 14 deletions src/components/com_weblinks/tmpl/categories/default_items.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,27 @@
<?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)) : ?>
Expand All @@ -51,18 +63,7 @@
<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
Expand Down

0 comments on commit e01ce03

Please sign in to comment.