Group by menu in horizontal

enzo2016

Member
Hi,
could the Group by menu be displayed in horizontal instead of dropdown? In other words, like nav-pills compared with language of joomla menu.


Thanks,
Enzo
 
That menu is built in the template:

components/com_fabrik/views/list/tmpl/bootstrap/default_buttons_btn_group.php

... at line 17 ...

Code:
    <?php if ($this->canGroupBy) :?>
        <div class="btn-group">
            <a href="#" class="btn dropdown-toggle groupBy" data-toggle="dropdown">
                <?php echo FabrikHelperHTML::icon('icon-list-view', FText::_('COM_FABRIK_GROUP_BY'));?>
            </a>
            <ul class="dropdown-menu">
                <?php foreach ($this->groupByHeadings as $url => $obj) {?>
                    <li><a data-groupby="<?php echo $obj->group_by?>" href="<?php echo $url?>"><?php echo $obj->label?></a></li>
                <?php
                }?>
            </ul>
        </div>
    <?php endif ?>

... so you'd have to use a custom template and edit that to suit.

-- hugh
 
That menu is built in the template:

components/com_fabrik/views/list/tmpl/bootstrap/default_buttons_btn_group.php

... at line 17 ...

Code:
    <?php if ($this->canGroupBy) :?>
        <div class="btn-group">
            <a href="#" class="btn dropdown-toggle groupBy" data-toggle="dropdown">
                <?php echo FabrikHelperHTML::icon('icon-list-view', FText::_('COM_FABRIK_GROUP_BY'));?>
            </a>
            <ul class="dropdown-menu">
                <?php foreach ($this->groupByHeadings as $url => $obj) {?>
                    <li><a data-groupby="<?php echo $obj->group_by?>" href="<?php echo $url?>"><?php echo $obj->label?></a></li>
                <?php
                }?>
            </ul>
        </div>
    <?php endif ?>

... so you'd have to use a custom template and edit that to suit.

-- hugh
 
That menu is built in the template:

components/com_fabrik/views/list/tmpl/bootstrap/default_buttons_btn_group.php

... at line 17 ...

Code:
    <?php if ($this->canGroupBy) :?>
        <div class="btn-group">
            <a href="#" class="btn dropdown-toggle groupBy" data-toggle="dropdown">
                <?php echo FabrikHelperHTML::icon('icon-list-view', FText::_('COM_FABRIK_GROUP_BY'));?>
            </a>
            <ul class="dropdown-menu">
                <?php foreach ($this->groupByHeadings as $url => $obj) {?>
                    <li><a data-groupby="<?php echo $obj->group_by?>" href="<?php echo $url?>"><?php echo $obj->label?></a></li>
                <?php
                }?>
            </ul>
        </div>
    <?php endif ?>

... so you'd have to use a custom template and edit that to suit.

-- hugh
 
Yes Hugh! Thank you very very much.



For people reading this thread without knowledge in programming code (like me), I used the following code (the amendements are underlined):

Code:
    <?php if ($this->canGroupBy) :?>
        <div class="container">
            <a href="#" class="btn dropdown-toggle groupBy" data-toggle="dropdown">
                <?php echo FabrikHelperHTML::icon('icon-list-view', FText::_('COM_FABRIK_GROUP_BY'));?>
            </a>
            <ul class="nav nav-pills">
                <?php foreach ($this->groupByHeadings as $url => $obj) {?>
                    <li><a data-groupby="<?php echo $obj->group_by?>" href="<?php echo $url?>"><?php echo $obj->label?></a></li>
                <?php
                }?>
            </ul>
        </div>
    <?php endif ?>

If the row "Group by" is not liked, then is possible to delete the following code:
Code:
 <a href="#" class="btn dropdown-toggle groupBy" data-toggle="dropdown">
                <?php echo FabrikHelperHTML::icon('icon-list-view', FText::_('COM_FABRIK_GROUP_BY'));?>
            </a>

There are different ways to make a horizontal menu, so it could be possible to replace nav-pills with nav-tabs. There are really many ways for styling a horizontal menu. I used this page to learn (https://www.w3schools.com/bootstrap/bootstrap_tabs_pills.asp).

Enzo
 
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top