Lise - display Category name

Have a question or a suggestion about a 3rd party addon module or plugin?
Let us know here.
Post Reply
User avatar
erpee
Power Poster
Power Poster
Posts: 767
Joined: Sat Jul 07, 2007 9:22 am
Location: Almelo, The Netherlands

Lise - display Category name

Post by erpee »

In my Lise module, I've created a category called: 'cat'
category.jpg
category.jpg (3.85 KiB) Viewed 401 times
The category is filled with data like this:
category 2.jpg
In my template I want to use te data using:

Code: Select all

{$item->fielddefs.cat.value}<br />
But, When I expect 'M3', it shows '1'
Is there a way to to make it show the 'M3'?
Waarom zou het direct goed moeten gaan? Dan is alle lol weg ...
User avatar
Jo Morg
Dev Team Member
Dev Team Member
Posts: 1800
Joined: Mon Jan 29, 2007 4:47 pm

Re: Lise - display Category name

Post by Jo Morg »

Look at the sample templates! They serve as documentation too.
LISE categories are arrays so the way you get the values depend both on how you have the categories set up and on how you want to display them on your template.
"There are 10 types of people in this world, those who understand binary... and those who don't."
* by the way: English is NOT my native language (sorry for any mistakes...).
Code of Conduit | CMSMS Docs | Help Support CMSMS
My developer Page on the Forge | Yet another blog about CMSMS
GeekMoot 2015 in Ghent, Belgium: I was there!
GeekMoot 2016 in Leicester, UK: I was there!
johnboyuk1
Forum Members
Forum Members
Posts: 103
Joined: Mon Nov 26, 2018 3:09 pm

Re: Lise - display Category name

Post by johnboyuk1 »

bit late, but as I was just looking for the solution myself thought I'd post here what I'd worked out for the benefit of anyone else... this is the code I've put in my summary template in order to display the category name associated with each item

Code: Select all

{foreach from=$item->fielddefs item=fielddef}
{if $fielddef.type == 'Categories' && ($fielddef.value != '')}
{LISELoader item='category' force_array=1 value=$fielddef.value assign='cats'}
Category: {implode(',', $cats)}
{/if}
{/foreach}
User avatar
Rolf
Dev Team Member
Dev Team Member
Posts: 7749
Joined: Wed Apr 23, 2008 7:53 am
Location: The Netherlands
Contact:

Re: Lise - display Category name

Post by Rolf »

Image
- + - + - + - + - + -
Latest CMSMS tutorial: FormBuilder WatchGuard
- + - + - + - + - + -
Did my post help you solving a problem at your (customers) website and it saved you many hours of work?
Great!! Buy me a cup of coffee in return as a small token of appreciation!
Post Reply

Return to “Modules/Add-Ons”