Filter by category ListIt, best solution

Have a question or a suggestion about a 3rd party addon module or plugin?
Let us know here.
Post Reply
Sakrow
Forum Members
Forum Members
Posts: 23
Joined: Wed Jun 23, 2010 7:05 pm

Filter by category ListIt, best solution

Post by Sakrow »

Hi, do a filter by category in ListIt2, but i think that exist one best form to do this.

Sorry form my english

My ListIt2 instance have:

Definition --> alias --> type

descripcion --> descripcion --> text area
url --> url --> text input
foto --> foto --> GBFilePicker
servicios --> servicios --> Multi-Select
Fecha_De_Creacion --> fecha_de_creacion --> Date
categoria --> categoria --> category

This is the detail template:

Code: Select all

<div class="detalle-proyecto">
<figure>
<img src="{root_url}/uploads/{$item->fielddefs.foto}" class="img-responsive" title="{$item->title|cms_escape}" alt="Imagen del proyecto {$item->title|cms_escape}" />
<figcaption class="text-center"><a href="{$item->fielddefs.url}" title="Url de {$item->title|cms_escape}" target="_blank">{$item->fielddefs.url}</a></figcaption>
</figure>
	<div class="row">
		<div class="col-xs-12 col-sm-12 col-md-4">
			<h2 class="text-center">Descripción del Proyecto</h2>
			{$item->fielddefs.descripcion}
		</div>
		<div class="col-xs-12 col-sm-6 col-md-4 detalle-servicios">
			<h2 class="text-center">Servicios Prestados</h2>
			{$item->fielddefs.servicios}
		</div>
		<div class="col-xs-12 col-sm-6 col-md-4">
			<h2 class="text-center">Tecnologías Usadas</h2>
			{ListIt2Proyectos action="category" template_category="listado-categorias-detalle"}
		</div>
	</div>
</div>
<div class="text-center"><a href="{$return_url}" class="btn-mas">Volver a Proyectos</a></div>
An this is the category template:

Code: Select all

{assign var="categorias" value=","|explode:$item->fielddefs.categoria}
{foreach from=$categories item=category}
{if in_array($category->category_id, $categorias)}
  <span class="categoria"><a href="{$category->url}">{$category->name} </a></span>
{/if}	
{/foreach}
And this is the result:

http://dev.sakrow.com/sakrow/proyectos/sector-med/58

Works, but y think that exist best form to do this. I feel that is a lot of complicated to do.

Has anyone done this differently? I would like to know how.

Thank you all for your time
Post Reply

Return to “Modules/Add-Ons”