Page 1 of 1

ListIt2 and Gallery Issue

Posted: Thu May 08, 2014 10:16 pm
by delve2013
i have setup ListIt2 and Gallery to work together for my portfolio or work page on my website.

I have setup a new instance called "Work" and within this instance I have various fields such as:

- Client (text field)
- Title (text field)
- Project (text area)
- Gallery (which is a drop down)
- Description (text area)

I have created the galleries for each portfolio item using the Gallery module.

Using the Gallery drop down field in my Work instance I can select which gallery I want to link to.

The problem I'm having is that no matter what gallery I choose to link too each one is showing the same gallery. All the galleries have been created, each one has a unique name and alias and the drop down in my instance is pointing to the correct gallery.

Anyone know why this is not working?

Re: ListIt2 and Gallery Issue

Posted: Thu May 08, 2014 11:54 pm
by Stikki
Some code snippet how your calling gallery inside LI templates would be helpful

Re: ListIt2 and Gallery Issue

Posted: Fri May 09, 2014 1:18 am
by Stikki
So where is that Gallery call in this template?

Modules dont magically do anything together, else you make em to do it.

Gallery field in LI provides simple way to get gallery name to template context, but you have to make it work.

{Gallery dir=$item->gallery_field_alias}

Or something, use your imagination.

PS: i think i accidentally deleted your original reply, sorry for that.

Re: ListIt2 and Gallery Issue

Posted: Fri May 09, 2014 10:22 am
by delve2013
hi here is the detail template:

Code: Select all

 {capture assign='currentID'}{$item->item_id}{/capture}
 {capture assign="foox"}{ListIt2project summarytemplate='pager' action='default' orderby='item_position|DESC'}{/capture}
 {foreach from=$allIDs item=someID name=findmyID}
 {if $currentID == $someID}
 {assign var=currentkey value=$smarty.foreach.findmyID.index}
 {/if}
 {/foreach}
<div class="content-nav">
<div class="controls">
<a href="index.php?page=work" class="grid-icon"><img src="images/grid-icon.svg"></a>
{assign var=prevkey value=$currentkey+1}
{if isset($allURLs[$prevkey])}
<a href="{$allURLs[$prevkey]}" class="prev">
<img src="images/prev-icon.svg"></a>
{/if}
{assign var=nextkey value=$currentkey-1}
{if isset($allURLs[$prevkey]) and isset($allURLs[$nextkey])}<span class="light"> | </span>
{/if}
{if isset($allURLs[$nextkey])}
<a href="{$allURLs[$nextkey]}" class="next">
<img src="images/next-icon.svg"></a>
{/if}
</p>
</div>
</div>
<!-- item -->
<div class="item-detail">
	<h2 class="item-title-detail">{$item->title|cms_escape}</h2>

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

	<div class="item-properties">
		{foreach from=$item->fielddefs item=fielddef}

		{*
			Categories were moved to field definitions.
			If you need Categories, create new Field definition with alias "category"
			and Categories will be available again.
		*}

		{if $fielddef.type == 'Categories' && ($fielddef.value != '')}

			{* use ListIt2Loader plugin if you need Category information in default module action templates *}
			{ListIt2Loader item='category' force_array=1 value=$fielddef.value assign='cats'}
	
			<!-- categories -->
			<div class="item-category">
				Category: {$cats|implode:','}
			</div>
			<!-- categories //-->
			
		{/if}

		{if $fielddef.value && $fielddef.type != 'Categories'}
			{if $fielddef.type == 'SelectFile' || $fielddef.type == 'FileUpload'}
				
		{else}
			
			{/if}
		{/if}

		{/foreach}

<span class="serv">{$item->fielddefs.services.value}</span>
<span class="intro-content">{$item->fielddefs.description_1.value}</span>
{Gallery dir={$item->gallery|cms_escape}}
<div class="about-the-work">
{$item->fielddefs.description_2.value}
</div>
	</div>

	{/if}
	
	<a href="{$return_href}" class="return-link">return</a>
	{* or use {$return_link} to create link tag *}
	
</div>
<!-- item //-->


Re: ListIt2 and Gallery Issue

Posted: Fri May 09, 2014 10:24 am
by Stikki
{Gallery dir={$item->gallery|cms_escape}}

to

{Gallery dir=$item->gallery}

Re: ListIt2 and Gallery Issue

Posted: Fri May 09, 2014 11:38 am
by delve2013
Hi just tried that, and it's still giving me the same problem.

Re: ListIt2 and Gallery Issue

Posted: Fri May 09, 2014 11:40 am
by Stikki
No idea then.

Can't code it for you, i know it works, its just matter of getting working.

Good luck.