Listit2 & category_alias

Have a question or a suggestion about a 3rd party addon module or plugin?
Let us know here.
Post Reply
przemo
Forum Members
Forum Members
Posts: 23
Joined: Mon Dec 30, 2013 12:58 pm

Listit2 & category_alias

Post by przemo »

Hello,
Again, I need your help...
To my detail template, I need to pass a parameter {category_alias} to present other products in this category currently we are. I tried the [ListIt2Loader], but unfortunely it passes the category name - not the category alias.
My template looks like this:

Code: Select all

...
{if !empty($item->fielddefs)}

		{foreach from=$item->fielddefs item=fielddef}
		{if $fielddef.type == 'Categories' && ($fielddef.value != '')}
			{ListIt2Loader item='category' force_array=1 value=$fielddef.value assign='cats'}
		{/if}
		{/foreach}		

{/if}

{ListIt2Oferta template_summary="rotator" detailpage="66" category="{$cats}"}
...
I use ListIt2 1.4.1 and CMSMS 1.11.9

Someone has an idea?
przemo
Forum Members
Forum Members
Posts: 23
Joined: Mon Dec 30, 2013 12:58 pm

Re: Listit2 & category_alias

Post by przemo »

Hi,
Problem solved!
I don't really know if in the simplest way, but it works well.

I added to my code:

Code: Select all

{assign var="kategorie" value=","|explode:$item->fielddefs.kategoria}
{foreach from=$cats item=category}
{if in_array($category->category_id, $kategorie)}
  
{ListIt2Oferta template_summary="rotator" detailpage="66" category="{$category->alias}"}
{/if}   
{/foreach}
I leave this post for anyone else who has a similar problem.
Best regards,
Post Reply

Return to “Modules/Add-Ons”