Problems using targetpage="" with Gallery module

Have a question or a suggestion about a 3rd party addon module or plugin?
Let us know here.
Post Reply
krillzip
New Member
New Member
Posts: 8
Joined: Wed Sep 03, 2008 11:09 am

Problems using targetpage="" with Gallery module

Post by krillzip »

Environment:
CMSMS 1.7
Gallery module 1.3.2
PHP 5
Runs om Gentoo Linux

What I am trying to do:

I have one page (A) displaying subgalleries:

Code: Select all

...
<div class="wide">
	{Gallery start=1 number=3 targetpage="B"}
</div>
...
Gallery template code

Code: Select all

<ul class="albumlarge selfClear gallery">
{foreach from=$images item=image name=gallery}
	{if $image->isdir}
<li {if $smarty.foreach.gallery.iteration % 3 != 0} style="margin-right: 20px;"{/if}><a href="{$image->file}" title="{$image->titlename}"  rel="lightbox[gallery]"><span class="border"><img src="{$image->thumb}" alt="{$image->titlename}" /></span>{$image->titlename}<span>{$image->comment}</span></a></li>
	{/if}
{/foreach}
</ul>
Clicking on the pictures loads the targetpage (B) but the subgallery doesn't show.

Gallery template code

Code: Select all

<ul class="albumlarge selfClear gallery">
{foreach from=$images item=image name=gallery}
	{if !$image->isdir}
<li {if $smarty.foreach.gallery.iteration % 3 != 0} style="margin-right: 20px;"{/if}><a href="{$image->file}" title="{$image->titlename}"  rel="lightbox[gallery]"><span class="border"><img src="{$image->thumb}" alt="{$image->titlename}" /></span>{$image->titlename}<span>{$image->comment}</span></a></li>
	{/if}
{/foreach}
</ul>
I have tried a number of combinations and solutions on the targetpage (B), having a {content} block, using {Gallery template="page  B"} and no one seems to work.

How should I make the targetpage showing the clicked subgallery?
:-\
Jos
Support Guru
Support Guru
Posts: 4019
Joined: Wed Sep 05, 2007 8:03 pm
Location: The Netherlands

Re: Problems using targetpage="" with Gallery module

Post by Jos »

Does the template of page B have at least a normal {content} tag in it? Gallery replaces the {content} tag with its gallerycontent.
krillzip
New Member
New Member
Posts: 8
Joined: Wed Sep 03, 2008 11:09 am

Re: Problems using targetpage="" with Gallery module

Post by krillzip »

Have tried with and without. But as you say now there is a {content} field but no images showing up.
krillzip
New Member
New Member
Posts: 8
Joined: Wed Sep 03, 2008 11:09 am

Re: Problems using targetpage="" with Gallery module

Post by krillzip »

What I have done:

On all my galleries a manually set the prefered template to a detail page template. So now the pictures show up.

There is however another issue, when I click one gallery on page A there will only be displayed three pictures on page B, because on page A {Gallery number=3} is set.

Is there a way to forget this parameter on the request to page B?
Jos
Support Guru
Support Guru
Posts: 4019
Joined: Wed Sep 05, 2007 8:03 pm
Location: The Netherlands

Re: Problems using targetpage="" with Gallery module

Post by Jos »

krillzip wrote: Is there a way to forget this parameter on the request to page B?
You can set the number of images per page in the gallerytemplate you use on page A, in stead of a parameter in the tag. That way the setting wil l not be inherited
krillzip
New Member
New Member
Posts: 8
Joined: Wed Sep 03, 2008 11:09 am

[SOLVED] Problems using targetpage="" with Gallery module

Post by krillzip »

Tried it but guess that the gallery still sends the information. The link looks like

.../index.php/gallery/Test 2/1-3-67

where 1-3-67 is variables.

However I solved the problem with a Smarty hack:

Code: Select all

<a href="{$image->file|regex_replace:"/\/1-(\d*)/":"/1-1000"}" ...
the regex setting 1-3-67 to 1-1000-67, which is on those links that does not have the number="" attribute set.

At least it solves the problem for me.

;)

thnx for your time
Last edited by krillzip on Wed Aug 04, 2010 3:28 pm, edited 1 time in total.
Post Reply

Return to “Modules/Add-Ons”