Repeater with lightbox

Artemy Sokolov asked on March 25, 2014 06:12

Hello,

How could look transformation for repeater with lightbox? I need this effect to the product image, found and using this sample for now: <%# IfEmpty(Eval("SKUImagePath"), "<img src=\"" + GetSKUImageUrl(240) + "\" class='fancyboxProductImg' alt=\"" + EvalText("SKUName", true) + "\" />","<a href=\"" + GetSKUImageUrl(960) + "\" class='fancyboxProductImg' title=\"" + EvalText("SKUName", true) + "\"><img src=\"" + GetSKUImageUrl(240) + "\" class='fancyboxProductImg' title=\"" + EvalText("SKUName", true) + "\" /></a>") %>

But it works only with attachment carousel with lightbox, is there any samples how to work with this webpart?

Best regards

Recent Answers


Richard Sustek answered on March 26, 2014 01:57

Hi Artemy,

Thank you for your message.

Well, in this case when you want to use some lightBox effect it would be best if you could take a look at some online tutorials for lightbox jquery plugins which is what we use. Most of the plugins are very easy to setup and you only need use jQuery, load given script, styles (Use ScriptHelper and CSSHelper classes for this purpose) and then make up your markup as per the given plugin.

To give you precise samples please check link text

Kind regards,

Richard Sustek

2 votesVote for this answer Mark as a Correct answer

Artemy Sokolov answered on March 26, 2014 07:48

Thank you for your answer,

Added jq fancybox on site and found that it can't open images in .aspx format, for example, this one working perfect:

<a class="fancybox" href="http://farm4.staticflickr.com/3712/9032543579_1217e6566b_b.jpg">
<img src="http://farm4.staticflickr.com/3712/9032543579_1217e6566b_m.jpg"></img>

and this one redirects to the image page:

<a class="fancybox" href="/getmetafile/89349a1b-f0a8-464d-8591-04168656abd2/Blue.aspx?maxsidesize=960">
<img src="/getmetafile/89349a1b-f0a8-464d-8591-04168656abd2/Blue.aspx?maxsidesize=240"></img>

Is it possible to change image urls to default formats? Or maybe here another solution?

p.s. same problem not only with fancybox

Best regards

0 votesVote for this answer Mark as a Correct answer

Yonatan Glassner answered on February 11, 2015 11:49 (last edited on February 11, 2015 11:52)

You can try this (I'm using kentico 8.1)

  <a href="<%# HTMLHelper.HTMLEncode(MediaLibraryFunctions.GetMediaFileDirectUrl(Eval("FileLibraryId"),Eval("FilePath"))) %>" class="fancybox">
      <img src="/getmetafile/89349a1b-f0a8-464d-8591-04168656abd2/Blue.aspx?maxsidesize=240"></img>
    </a>
0 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.