LISE - anyone know how to filter by category?

Have a question or a suggestion about a 3rd party addon module or plugin?
Let us know here.
Post Reply
User avatar
velden
Dev Team Member
Dev Team Member
Posts: 3483
Joined: Mon Nov 28, 2011 9:29 am
Location: The Netherlands

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

Post 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.
User avatar
velden
Dev Team Member
Dev Team Member
Posts: 3483
Joined: Mon Nov 28, 2011 9:29 am
Location: The Netherlands

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

Post by velden »

I think it would be rather easy with categories too.
User avatar
velden
Dev Team Member
Dev Team Member
Posts: 3483
Joined: Mon Nov 28, 2011 9:29 am
Location: The Netherlands

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

Post 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.


Post Reply

Return to “Modules/Add-Ons”