ListiIt2 - display category name

Have a question or a suggestion about a 3rd party addon module or plugin?
Let us know here.
Locked
User avatar
Dr.CSS
Moderator
Moderator
Posts: 12711
Joined: Thu Mar 09, 2006 5:32 am

Re: ListiIt2 - display category name

Post 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...
LB Back
Forum Members
Forum Members
Posts: 20
Joined: Sat Jan 31, 2009 3:48 pm

Re: ListiIt2 - display category name

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

Re: ListiIt2 - display category name

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

Re: ListiIt2 - display category name

Post by velden »

What version of cmsms and LI2 are we talking about?
User avatar
velden
Dev Team Member
Dev Team Member
Posts: 3497
Joined: Mon Nov 28, 2011 9:29 am

Re: ListiIt2 - display category name

Post by velden »

Just tested and the default summary template just displays category NAME out of the box.
User avatar
velden
Dev Team Member
Dev Team Member
Posts: 3497
Joined: Mon Nov 28, 2011 9:29 am

Re: ListiIt2 - display category name

Post 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.
pedes
Power Poster
Power Poster
Posts: 840
Joined: Tue Jan 27, 2009 11:47 am

Re: ListiIt2 - display category name

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

Re: ListiIt2 - display category name

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

Return to “Modules/Add-Ons”