Page 1 of 1

Re: LISE - anyone know how to filter by category?

Posted: Thu Jul 05, 2018 2:07 pm
by velden
Isotope might be a solution for this; load all items and filter by class for example.

https://isotope.metafizzy.co/

You'd need to get the categories of the item, and turn them into proper class names.

Of course the buttons should be created for filtering. I bet this can be done in some automated way too.

Re: LISE - anyone know how to filter by category?

Posted: Thu Jul 05, 2018 2:23 pm
by velden
I think it would be rather easy with categories too.

Re: LISE - anyone know how to filter by category?

Posted: Thu Jul 05, 2018 3:01 pm
by velden

Code: Select all

...
{foreach from=$items item=item}

{LISELoader item=category force_array=1 value=$item->fielddefs['CATEGORY_FIELDDEF_ALIAS'].value assign=cats}

<div class="{foreach $cats as $cat}{$cat->alias} {/foreach}">
...

This will print the contents of the $cats array. 
<pre>{$cats|print_r}</pre>
You will see it will contains the name ($cats->name) and description ($cats->description) too. Even the items (ids) which have this category are available.