The following will add 2 options (at the flexicontent directory menu item)
-- One option to hide empty categories
-- One option to hide empty Subcategories
Note: As empty categories are considered the ones that:
1. Have no assigned items
2. All their subcategories have no assigned items, and have no subcategories.
Note: As empty subcategories are considered the ones that have no assigned items, and have no subcategories.
--CHANGE 1 --
At file:
components/com_flexicontent/views/flexicontent/tmpl/default.xml
Just after line:
<param name="catlimit" type="text" ...
add the code:
Code:
<param name="hide_empty_cats" type="radio" default="0" label="FLEXI_HIDE_EMPTY_CATS" description="FLEXI_HIDE_EMPTY_CATS_DESC">
<option value="0">FLEXI_SHOW</option>
<option value="1">FLEXI_HIDE</option>
</param>
<param name="hide_empty_subcats" type="radio" default="0" label="FLEXI_HIDE_EMPTY_SUBCATS" description="FLEXI_HIDE_EMPTY_SUBCATS_DESC">
<option value="0">FLEXI_SHOW</option>
<option value="1">FLEXI_HIDE</option>
</param>
-- CHANGE 2 --
At file:
components/com_flexicontent/views/flexicontent/tmpl/default_categories.php
Just after about line 52:
<?php foreach ($this->categories as $sub) : ?>
add the code:
Code:
<?php
if ($this->params->get('hide_empty_cats')) {
$subcats_are_empty = 1;
if (!$sub->assigneditems) foreach($sub->subcats as $subcat) {
if ($subcat->assignedcats || $subcat->assignedsubitems) {
$subcats_are_empty = 0;
break;
}
} else {
$subcats_are_empty = 0;
}
if ($subcats_are_empty) continue;
}
?>
and Just after about line :
foreach ($sub->subcats as $subcat) ...
add the code:
Code:
<?php
if ($this->params->get('hide_empty_subcats')) {
if (!$subcat->assignedcats && !$subcat->assignedsubitems) continue;
}
?>
-- CHANGE 3 --
If you want translations
Then in files: /administrator/language/ll-LL/ll-LL.com_flexicontent.ini
Add the strings:
FLEXI_HIDE_EMPTY_CATS=Hide Empty Categories
FLEXI_HIDE_EMPTY_CATS_DESC=As empty categories are considered the ones that:<br>1. Have no assigned items<br>2. All their subcategories have no assigned items, and have no subcategories.
FLEXI_HIDE_EMPTY_SUBCATS=Hide Empty Subcategories
FLEXI_HIDE_EMPTY_SUBCATS_DESC=As empty subcategories are considered the ones that have no assigned items, and have no subcategories.
Regards