Category titles switching from Listit2 to LISE

Have a question or a suggestion about a 3rd party addon module or plugin?
Let us know here.
Post Reply
martinpescador
Forum Members
Forum Members
Posts: 16
Joined: Wed Jun 27, 2007 6:32 pm

Category titles switching from Listit2 to LISE

Post by martinpescador »

Hello together,

I have a question about LISE after updating from Listit2. I have some entries as "accordeon links" which extend on click (containing a text ("beschreibung" and some images ("gallery")), which should be sorted by category, with the category as a title. Like this:

Category 1
Entry 1 (extends on click)
Entry 2 (extends on click)
Entry 3 (extends on click)

Category 2
...


In Listit2, I managed to do it like that:

Code: Select all

{assign var='current_category' value=''}
{assign var='open' value=false}

{foreach from=$items item=item}

{if $current_category != $item->category_alias}
    {if $open}</div><!-- items -->{/if}
    <h1 class="category-title">{$item->category_name|cms_escape}</h1>
    <div class="items">
    {assign var='current_category' value=$item->category_alias}
    {assign var='open' value=true}
{/if}

<div id="accordion" class="item">
<h2 class="item-title">{$item->title|cms_escape}</h2>
<div class="item-content">
{if !empty($item->fielddefs)}
    <div class="item-properties">
    {foreach from=$item->fielddefs item=fielddef}
      
                         {if !empty($fielddef.value) && ($fielddef.name != 'gallery')}  
    {$fielddef.value|cms_escape}
{/if}
                         
       
    {/foreach}
{capture assign="gallery"}{$item->fielddefs.gallery.value}{/capture}
{Gallery dir=$gallery template="fancybox"}

   </div> </div>
{/if}
</div>
{/foreach}
</div>
That doesn't work anymore, and now I am trying since quite some time, and I cant really figure out how to get the same results, because I do not really understand the rules which apply depending on which template category (category, summary, detail, search) is selected actually.

Can you give me a hint how I would have to proceed to display the categories?
Thank you very much already.
User avatar
Jo Morg
Dev Team Member
Dev Team Member
Posts: 1967
Joined: Mon Jan 29, 2007 4:47 pm

Re: Category titles switching from Listit2 to LISE

Post by Jo Morg »

You may be struggling with Smarty variable scopes. Check this article in Rolf's tutorials site. That might help.
"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 Condut | CMSMS Docs | Help Support CMSMS
My developer Page on the Forge
GeekMoot 2015 in Ghent, Belgium: I was there!
GeekMoot 2016 in Leicester, UK: I was there!
DevMoot 2023 in Cynwyd, Wales: I was there!
Post Reply

Return to “Modules/Add-Ons”