Results 1 to 7 of 7

Thread: Initiate gallery from a single image

  1. #1
    New user
    Join Date
    03-08-10.
    Posts
    22

    Default Initiate gallery from a single image

    Hi there.

    I've been struggling to get the gallery-extension to open from a single image in an article. Can anybody tell me how I do this? Shouldn't it just be going into an article and selecting "new element" and then "gallery". When I do this there is no option on using a single image to launch the gallery.

    Can anybody help me?

    Thank you
    /Njilski

  2. #2
    User
    Join Date
    06-19-09.
    Posts
    89

    Default Re: Initiate gallery from a single image

    I'm not sure I understand. You want to have a single image link to a gallery?

    You would create a page with a single image on it. When this image is clicked, it would link to a second page with a gallery on it?

    Is that the basic idea?

  3. #3
    New user
    Join Date
    03-08-10.
    Posts
    22

    Default Re: Initiate gallery from a single image

    Hi Justin and thanks for your reply.

    The basic idea is that I would like to initiate the lightbox-gallery from clicking a single image from an article page. I have also thought about making a second page with gallery on it as an alternative, but would prefer if the gallery would load as lightbox so I didn't have to make too many pages.

    Best regards
    Andreas

  4. #4

    Default Re: Initiate gallery from a single image

    Edited the gallery_default.tpl
    OM MANI PEME HUNG! how many has to die for freedom and dignity. Save this world

  5. #5
    New user
    Join Date
    03-08-10.
    Posts
    22

    Default Re: Initiate gallery from a single image

    Thanks for the comeback Tsarma.

    I thought about that I might need to edit the template, but can't see my way through how to do it. Can you tell me how you edited the gallery_default.tpl if you have already made this modification?

    Thank you.

  6. #6

    Default Re: Initiate gallery from a single image

    For example :

    Code:
    <?php $i=0; ?>
    <?php foreach ($this->body as $class=>$row): ?>
    <?php foreach ($row as $col): ?>
    <?php if (!$col->addImage): ?>
    <?php else: ?>
    <?php if($i<=0):?>
      	 <div class="image_container"<?php if ($col->margin): ?> style="<?php echo $col->margin; ?>"<?php endif; ?>>
    		<?php if ($col->href): ?>
        	<a href="<?php echo $col->href; ?>"<?php echo $col->attributes; ?> title="<?php echo $col->alt; ?>">
        		[img]<?php echo $col->src; ?>[/img]imgSize; ?> alt="<?php echo $col->alt; ?>" />
        	</a>
    		<?php $i++; else: ?>
    	  		[img]<?php echo $col->src; ?>[/img]imgSize; ?> alt="<?php echo $col->alt; ?>" />
    		<?php endif; ?>
      	</div>
    <?php else :?>
        	<a href="<?php echo $col->href; ?>"<?php echo $col->attributes; ?> title="<?php echo $col->alt; ?>" class="invisible">
        		[img]<?php echo $col->src; ?>[/img]alt; ?>" />
        	</a>
    <?php endif; ?>
    <?php endif; ?>
    <?php endforeach; ?>
    <?php endforeach; ?>
    Please be warned I didn't test it in all situations, may be you can improve it much better.
    OM MANI PEME HUNG! how many has to die for freedom and dignity. Save this world

  7. #7
    New user
    Join Date
    03-08-10.
    Posts
    22

    Default Re: Initiate gallery from a single image

    Thank you so much for your reply.

    I will test it later this week and if I'm able to improve it, I will contact you and give you an update

    /Andreas

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •