Page 1 of 1

Re: ListiIt2 - display category name

Posted: Fri Jan 29, 2016 5:30 pm
by Dr.CSS
It comes with some kind of category thing but it has to be activated in the main listit2 module admin under extensions and then do a def scan or some such silly stuff like that, it says this in the module somewhere...

Re: ListiIt2 - display category name

Posted: Mon Feb 01, 2016 10:05 am
by LB Back
In Listit2 categories are added by adding the Field Definition called "Categories". A new tab will appear, where you can add categories. This Field Definition can have a custom alias, calling it in a template is done like this:

Code: Select all

<div>{$item->yourcategoryalias}</div>
Obviously replace "yourcategoryalias" by the alias you gave it.

Re: ListiIt2 - display category name

Posted: Mon Feb 01, 2016 11:06 am
by velden
http://forum.cmsmadesimple.org/viewtopi ... =7&t=68991

Though note the imformation could be a little out-dated. Along development of LI2 things changed possibly.

IIRC ListIt2Loader is a plugin that comes with installation of LI2 module itself.

Re: ListiIt2 - display category name

Posted: Wed Feb 03, 2016 3:01 pm
by velden
What version of cmsms and LI2 are we talking about?

Re: ListiIt2 - display category name

Posted: Thu Feb 04, 2016 9:53 am
by velden
Just tested and the default summary template just displays category NAME out of the box.

Re: ListiIt2 - display category name

Posted: Thu Feb 04, 2016 10:33 am
by velden
You can't do it that way because the item object just hold the identifier of the category.

Check the default summary template that comes with an LI2 instance. It's in there.

Re: ListiIt2 - display category name

Posted: Wed Apr 13, 2016 4:43 pm
by pedes
I'm using the LISE (fork of LI2) and I'm also want to have the alias from the category id of the field definition category.

The output is the category id, but I would like to have the alias of that...

Anybody know how to do this?

Thank you
Kind regards
Peter

Re: ListiIt2 - display category name

Posted: Wed Apr 13, 2016 5:06 pm
by velden
There's some code in the sample (detail) template:

Code: Select all

{LISELoader item='category' force_array=1 value=$fielddef.value assign='cats'}
Category: {$cats|implode:','}
$fielddef.value might need to be replaced with the part that now gives you the Category id(s).

Note that this will return the titles, not the aliases