ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

How do I create a lightbox using Assets and CE Image

May 13, 2012 1:12am

Subscribe [2]
  • #1 / May 13, 2012 1:12am

    stephencapp

    12 posts

    I’m hoping someone might have some experience with something similar.

    I’m trying to build an image gallery that will use Assets for the user to add images to a gallery and use CE Image to properly size the preview thumbnail and the image in the lightbox.

    The part I’m stuck on is how to properly insert the CE Image code in the href. If you look at the code below you’ll see that I can get the thumbnail preview but I cannot figure out how to get the large image to appear in the path to activate the lightbox. What I’ve been trying to do is insert the same ce_img code in the href but have that sized to 800px. No luck so far… The image4.jpg is the static image I’ve been using for testing. It works fine.

    Any idea how to insert the CE Image code in the href?

    <div id="gallery">
      <ul>
       {gallery_images}
        <li>
         <a href="http://{site_url}photos/image4.jpg" title="Utilize a flexibilidade dos seletores da jQuery">_       {exp:ce_img:single src="{url}" max="250" title="{caption}" width="{width}" height="{height}" alt="{alt_text}"}_       </a>
          </li>
         {/gallery_images}
        </ul>
        </div>
  • #2 / May 15, 2012 11:51am

    Pv Ledoux

    95 posts

    Try this:

    {gallery_images}
        <li>
     <a href="http://{photofile_file}%22rel=%22gal_id_{entry_id}" rel="gal_id_{entry_id}" title="{photofile_title}">_  {exp:ce_img:pair src="{photofile_file}" max="250" crop="yes" filter="sharpen" src_fallback=""}_   {made}_  {/exp:ce_img:pair}_ </a>
          </li>
         {/gallery_images}

    For more info you can refer to the doc

    Pv

  • #3 / May 15, 2012 11:30pm

    stephencapp

    12 posts

    Hey thanks PV - I will give that a try.

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases