Exclude Sub Gallery [SOLVED]

Have a question or a suggestion about a 3rd party addon module or plugin?
Let us know here.
Post Reply
JM6891
Forum Members
Forum Members
Posts: 150
Joined: Thu Mar 18, 2010 2:35 pm

Exclude Sub Gallery [SOLVED]

Post by JM6891 »

Hi there,

I am using the Gallery module and currently all galleries are set up as subgalleries of the main {gallery}. However, I now need to add a subgallery which I do not want to display on the front end as part of the main {gallery} directory. Is it possible to exclude a subgallery? I've tried to find instructions on how to do this and even tried checking the gallery id but it seems it checks the gallery id of the current gallery, rather than the sub gallery.

Any help much appreciated.

Many thanks
Last edited by JM6891 on Mon Feb 10, 2014 11:03 am, edited 1 time in total.
User avatar
paulbaker
Dev Team Member
Dev Team Member
Posts: 1465
Joined: Sat Apr 18, 2009 10:09 pm
Contact:

Re: Exclude Sub Gallery

Post by paulbaker »

JM6891
Forum Members
Forum Members
Posts: 150
Joined: Thu Mar 18, 2010 2:35 pm

Re: Exclude Sub Gallery

Post by JM6891 »

Hi thank you for your reply. I actually worked around it using:

Code: Select all

{foreach from=$images item=image}
{if ($image->file) != 'http://www.domain.co.uk/gallery/subgallery/59.html'}
	<div class="img">

	{if $image->isdir}

		<a href="{$image->file}" title="{$image->title}"><img src="{$image->thumb}" alt="{$image->title}" /></a><br />
		{$image->title}

	{else}
   <a href="{$image->file}" title="{$image->title}" rel="lightbox[gallery]"><img src="{$image->thumb}" alt="{$image->title}" /></a>
	{/if}

	</div>
{/if}
{/foreach}
This is a manual edit but it works for what I need. It basically checks the sub gallery is not equal to the full url inserted.
User avatar
velden
Dev Team Member
Dev Team Member
Posts: 3497
Joined: Mon Nov 28, 2011 9:29 am

Re: Exclude Sub Gallery [SOLVED]

Post by velden »

Although 'solved' I'd like to comment:

I think a solution with hardcoded url (or whatever) should be prevented if possible.

Why don't you add an extra checkbox field (Gallery -> Field definitions tab) to the Gallery? It would be reusable for any other sub gallery added in the future. And if something changes (like domain name for example) it continues to work for you.
JM6891
Forum Members
Forum Members
Posts: 150
Joined: Thu Mar 18, 2010 2:35 pm

Re: Exclude Sub Gallery [SOLVED]

Post by JM6891 »

thank you for your reply! I completely agree! A hard coded option should be avoided, however in this instance time was against me, though I do plan to go back and make it more dynamic when I have a bit more time... thank you for the tip! this will be handy indeed and I'll update this thread with a better solution when I've got one working!
Post Reply

Return to “Modules/Add-Ons”