Developer forum

Forum » Templates » Image gallery issue

Image gallery issue


Reply

Hi!

 

I've been working with the image gallery module, and it's working fine with both the new GetImage-functionality and lightbox.

 

My only problem is that, if the total number of images does not match up with the number of rows/columns, the module will add "empty" images to fill out the empty places.

 

The result is that I have some good looking "missing image"-icons showing up in some browsers...

 

<a href="/admin/public/getimage.aspx?&Image=<!--@DwPicturePath-->&Width=600&Resolution=75&Compression=90" rel="lightbox[gal]" title="Foto: Valdres Folkehøgskule"><img src="/admin/public/getimage.aspx?&Image=<!--@DwPicturePath-->&Width=140&Resolution=75&Compression=90" class="galleri"></a>

 

 

This is the code that is within the list_element template for the gallery, and this is the exact output in the html for the emtpy spaces...

 

So this is kind of stupid. How can I avoid it?

 

Thanks!


Replies

 
Reply

Hi Christopher

 

Can you provide me with a link ?

 

// Dammark

 
Reply
Dammark wrote:

Hi Christopher

 

Can you provide me with a link ?

 

// Dammark

 

 

Of course :-)

 

http://dw.mellombels.no/Skolen/Bildegalleri.aspx

 
Reply

 

Hi Christopher,

 

I used this code in the List-Element template to get around that problem:

 

< script type="text/javascript" >
  var FilePathWithTag = '< !--@ThumbMedium-- >';
  var StrThumbs = FilePathWithTag.search("/thumbs");

  if (StrThumbs >= 0)
  {
    FilePath = '<table cellpadding="0" cellspacing="0" width="100%" class="ImageGallery_ThumbTable2"><tr><td valign="middle" align="center" class="ImageGallery_Thumb2"><a href="' + '< !--@DwPicturePath-- >' + '" rel="lightbox[CAgaleria]">< !--@ThumbMedium-- ><\/a><\/td><\/tr><\/table>';
  }
  else
  {
    FilePath = '';
  }

  document.writeln(FilePath);
< /script >

 

You just have to change the HTML construction and classes in accordance to your needs. What out for spaces i placed intentionally so the html would not break down in the forum

 

Best Regards

Nuno

 
Reply
nuno wrote:

 

Hi Christopher,

 

I used this code in the List-Element template to get around that problem:

 

< script type="text/javascript" >
  var FilePathWithTag = '< !--@ThumbMedium-- >';
  var StrThumbs = FilePathWithTag.search("/thumbs");

  if (StrThumbs >= 0)
  {
    FilePath = '<table cellpadding="0" cellspacing="0" width="100%" class="ImageGallery_ThumbTable2"><tr><td valign="middle" align="center" class="ImageGallery_Thumb2"><a href="' + '< !--@DwPicturePath-- >' + '" rel="lightbox[CAgaleria]">< !--@ThumbMedium-- ><\/a><\/td><\/tr><\/table>';
  }
  else
  {
    FilePath = '';
  }

  document.writeln(FilePath);
< /script >

 

You just have to change the HTML construction and classes in accordance to your needs. What out for spaces i placed intentionally so the html would not break down in the forum

 

Best Regards

Nuno

 

 

Thank you! Clever solution to a stupid problem.

 

You must be logged in to post in the forum