LISE hide categories with items ran out of date
Posted: Wed Sep 20, 2023 9:59 am
Hi cmsms-lovers,
all modules and cmsms are running under the current version using PHP 8.1.
I've created 12 categories in a LISE instance. One for every month of the year: january, february and so on. Like an event calendar.
All items have an end date using time control. If the event is over, the item will disappear.
The normal behavior of categories seems to be: As long as an item is not completly deleted and still stored in the database, the category name will be displayed. Even if all events have reached the end date.
But for a calendar it would be better to hide a category when there are no items to be found.
Is there a way to hide a category when a month is over and/or all items have passed the end date ?
It may help to show my categories template. It not working as a navigation tree. Every category/month opens an accordion container.
all modules and cmsms are running under the current version using PHP 8.1.
I've created 12 categories in a LISE instance. One for every month of the year: january, february and so on. Like an event calendar.
All items have an end date using time control. If the event is over, the item will disappear.
The normal behavior of categories seems to be: As long as an item is not completly deleted and still stored in the database, the category name will be displayed. Even if all events have reached the end date.
But for a calendar it would be better to hide a category when there are no items to be found.
Is there a way to hide a category when a month is over and/or all items have passed the end date ?
It may help to show my categories template. It not working as a navigation tree. Every category/month opens an accordion container.
Code: Select all
{foreach from=$categories item=category}
{if !empty($category->items|count)}
<div class="accordion">
<input type="checkbox" id="tab{$category->alias}" class="acco">
<label class="acco-label" for="tab{$category->alias}">{$category->name}</label>
<div class="acco-content">
{LISEEvents category=$category->alias}
</div>
{/if}
{/foreach}