Skip navigation
dpd5143
Currently Being Moderated

User submitted photo in a lightbox

Jul 9, 2012 8:25 PM

Tags: #photos #web #javascript #lightbox #apps #modules #submitted

I am absolutly perplexed. I'm trying to create a user submitted classifieds site, so users can sell items.  I would just like for the user to be able to submit photos and then have them display in a lightbox.

 

I downloaded a simple lightbox gallery into dreamweaver then uploaded the site to BC.  It came with demo images and worked fine (code below):

 

<div id="gallery1" class="lbGallery">

  <ul>

    <li> <a href="images/lightboxdemo1.jpg" title=""> <img src="images/lightboxdemo_thumb1.jpg" width="72" height="72" alt="" /> </a> </li>

    <li> <a href="images/lightboxdemo2.jpg" title=""> <img src="images/lightboxdemo_thumb2.jpg" width="72" height="72" alt="" /> </a> </li>

    <li> <a href="images/lightboxdemo3.jpg" title=""> <img src="images/lightboxdemo_thumb3.jpg" width="72" height="72" alt="" /> </a> </li>

    <li> <a href="images/lightboxdemo4.jpg" title=""> <img src="images/lightboxdemo_thumb4.jpg" width="72" height="72" alt="" /> </a> </li>

    <li> <a href="images/lightboxdemo5.jpg" title=""> <img src="images/lightboxdemo_thumb5.jpg" width="72" height="72" alt="" /> </a> </li>

  </ul>

</div>

<script type="text/javascript">

// BeginWebWidget lightbox_gallery

 

                    $(function() {

        $('#gallery1 a').lightBox();

    });

 

  // EndWebWidget lightbox_gallery

</script>

 

The tags for my photos are {tag_main photo}, {tag_photo#2} and so on to photo#5.  I had hoped that I could just delete the current image source and input my tags and the lightbox would function however it does not.  When I examine the code on the displayed page it shows that the tag does something like this...... <img src="src=........in other words the tag element supplies the command "src=" and messes things up.  If I remove the original src= command BC automatically alters the code and everything gets messed up.

 

Does anyone have any ideas, or even idiot proof code I could use (I'm still figuring this out and probably can't handle intense coding)

 

Thanks

 
Replies
  • Liam Dilley
    4,053 posts
    Feb 28, 2012
    Currently Being Moderated
    Jul 10, 2012 12:04 AM   in reply to dpd5143

    Hey there,

    Not sure what you mean exactly but are you saying your doing this:

     <img src="{tag_customfieldimage}" width="72" height="72" alt="" /> 
    

    But it renders all messed up?
    This is because that image custom field tag by default will render the full html of an image.

    If you want to just get the value of the image use..

     

    {tag_customfieldimage_value}

     
    |
    Mark as:
  • Currently Being Moderated
    Jul 10, 2012 7:35 AM   in reply to dpd5143

    Hi dpd5143,

     

    Liams answer is what you are looking for though.

     

    If you want to achieve this:

     

    <li> <a href="images/lightboxdemo1.jpg" title=""> <img src="images/lightboxdemo_thumb1.jpg" width="72" height="72" alt="" /> </a> </li>

     

    you need to do something like this:

     

    <li><a href="{tag_main photo_value}" title=""><img src="{tag_main photo_value}?Action=thumbnail&Width=72&Height=72" alt="" /></a></li>

     

    Nicole - BCGurus.com

     
    |
    Mark as:
  • Liam Dilley
    4,053 posts
    Feb 28, 2012
    Currently Being Moderated
    Jul 10, 2012 1:15 PM   in reply to Nicole - BCGurus.com

    A lot of people do not like the poor quality the thumbnail function produces Nicole, also if you want to do a crop snapshot of an image for good design you use as the above with another custom image field.

     
    |
    Mark as:
  • Liam Dilley
    4,053 posts
    Feb 28, 2012
    Currently Being Moderated
    Jul 10, 2012 3:39 PM   in reply to dpd5143

    I did not mention anything about the width, pointing out the _value of the tag to get the source.

     
    |
    Mark as:
  • Currently Being Moderated
    Jul 10, 2012 3:14 PM   in reply to Liam Dilley

    True, I'm not a fan of it either, but for user submitted items it might be the easiest solution without having the customer submit a thumbnail for each full width photo.

     
    |
    Mark as:
  • Liam Dilley
    4,053 posts
    Feb 28, 2012
    Currently Being Moderated
    Jul 10, 2012 3:41 PM   in reply to Nicole - BCGurus.com

    True, but often people want that snapshot sample or that positioned sqaure cut which a lot of other web applications support now. As you know BC is really slack on the modern web application interface and features side
    To much backend development.

     
    |
    Mark as:
  • Liam Dilley
    4,053 posts
    Feb 28, 2012
    Currently Being Moderated
    Jul 10, 2012 6:36 PM   in reply to dpd5143

    You have a javascript error:

     

    Error: $ is not a function

    Source File: http://yourboatconnection.businesscatalyst.com/boat-classifieds-1/3245 53425

    Line: 273

     

    You declared jQuery to be noConflict but then not using the noConflict method, still doing just $.

     
    |
    Mark as:
  • Liam Dilley
    4,053 posts
    Feb 28, 2012
    Currently Being Moderated
    Jul 10, 2012 7:45 PM   in reply to dpd5143

    Basically now you declared compatability you need to now not use the $.

    Any time you was using the $ you need to say jQuery

     

    jQuery("#element").fadeIn(); for example

     

    What you can do to make that shorter is:

    $j = jQuery.noConflict();

     

     

    What this will mean is that where you have $ you now do $j

     
    |
    Mark as:
  • Currently Being Moderated
    Jul 11, 2012 8:13 AM   in reply to dpd5143

    Hi,

     

    your reference to the script and css files in you source code is not correct (line 19, 20, 181, and 182), you can not link to a local file on your computer, you will need to upload the lightbox js and css to the BC site.

     

    Also, your a-tags need the rel-attribute:rel="lightbox".

     

    Check out the source code in my sandbox: http://nicolessandbox.hotpressplatform.com/lightbox-test.html

     

    Nicole - BCGurus.com

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points