Masquer les sous-catégories sans contenu dans l'annuaire

More
13 years 4 months ago #16530 by eytanpierre
Bonjour,

Je cherche à savoir comment masquer dans la vue "annuaire" les sous-catégories n'ayant aucun contenu et n'afficher que les sous-catégories possédant des contenus.
Et dès que j'ajoute un contenu dans une catégorie qui ne posséder pas auparavant de contenu, celui-ci s'affiche dorénavant dans l'annuaire.

Merci d'avance et encore bravo à l'équipe de Flexicontent (et de Joomla bien sûr, rendons à César ce qui appartient à César !) !!!!

Please Log in or Create an account to join the conversation.

More
13 years 4 months ago #16819 by ggppdk
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


-- Flexicontent is Free but involves a big effort on our part.
Like the our support? (for a bug-free FC, despite having a long list of functions) Like the features? Like the ongoing development and future commitment to FLEXIcontent?
-- Add your voice to the FLEXIcontent JED listing with a 5-star...

Please Log in or Create an account to join the conversation.

More
13 years 4 months ago #16853 by micker
:o

FLEXIcontent is Free but involves a very big effort on our part.
Like the our support? (for a bug-free FC, despite being huge extension) Like the features? Like the ongoing development and future commitment to FLEXIcontent?
-- Add your voice to the FLEXIcontent JED listing reviews. Thanks![/size]

Please Log in or Create an account to join the conversation.

Moderators: vistamediajoomlacornerggppdk
Time to create page: 0.387 seconds
Save
Cookies user preferences
We use cookies to ensure you to get the best experience on our website. If you decline the use of cookies, this website may not function as expected.
Accept all
Decline all
Essential
These cookies are needed to make the website work correctly. You can not disable them.
Display
Accept
Analytics
Tools used to analyze the data to measure the effectiveness of a website and to understand how it works.
Google Analytics
Accept
Decline