close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Question on making link from dynamic data

Thread began 11/19/2009 6:01 am by roger391472 | Last modified 11/23/2009 8:05 pm by roger391472 | 4743 views | 8 replies |

roger391472

Question on making link from dynamic data

I'm not sure this is the correct section but I thought I'd start here since it's dynamic data.

I'm trying to incorporate lightbox v2 on page to display full size photos from thumbnails. I've tried hand coding to make the links but I'm not getting anywhere with that. Here's what I'm doing. I've got a master display page that displays the dynamic data in repeating tables and the text is linked to a details page. I've got one full size photo and three thumbnails where I'm trying to link to display the full size photo but I can't get the code figured out to do the link. Is there a function in any of the extensions that would make this easier?

Here is the code for the image that I'm trying to link without any link coding:
<div id="lft_photo2_thumb"><img src="new_prod_thumb/<?php echo $row_rs_tech_page['prod_thumb2']; ?>"" name="new_prod_thumb_2" width="120" height="80" border="0" id="new_prod_thumb_2" /></div>

And here's the syntax that lightbox says to use but of course it's not dynamic data:
<a href="dog.jpg" rel="lightbox" ><img src="dog_thumb.jpg" /></a>

I've tried various ways to do it, mostly by replacing the "dog.jpg" with the dynamic binding and of course setting the correct source to new_prod_image_large/And_the_dynamic_binding.

I'm also needing to do this with another dynamic display field on the page and I haven't figured that one out yet either. For it, the user enters their full web url in the registration form and when I display it on the page I want to make it a working link to their site.

Any help would be greatly appreciated.

Thanks,

Roger

Sign in to reply to this post

Jason ByrnesWebAssist

your code looks correct, is it displaying the image?


I think you are just missing the anchor tag to make it a link:

php:
<div id="lft_photo2_thumb"><a href="<path to full size image>/<?php echo $row_rs_tech_page['<full size image column']; ?>" rel="lightbox" ><img  src="new_prod_thumb/<?php echo $row_rs_tech_page['prod_thumb2']; ?>" name="new_prod_thumb_2" width="120" height="80" border="0" id="new_prod_thumb_2" /></a></div>
Sign in to reply to this post

roger391472

Hi Jason,

Yep, the thumbnail version is displaying fine it just doesn't fire up the Lightbox full size version. The code you listed looks like one of the ways I had attempted but didn't work but I may have missed something. I'll try it again with your syntax.

Thanks,

Roger

Sign in to reply to this post

anonymous

Roger,

You definitely need to have the anchor tag as Jason suggested, but I believe you also need to tell the lightbox js that it should parse it by adding some sort of class attribute to the a tag.

For example, any of the photo albums on this page photos.php, when you enter an album, the context I use looks like this:

<a href="/user_albums/<?php echo $row_photos['albumID']; ?>/<?php echo $row_photos['image']; ?>" class="lightbox" title="<?php echo (htmlentities($row_photos['name'])); ?>"><img border="0" src="<?php echo $objDynamicThumb1->Execute(); ?>" alt="<?php echo $row_photos['name']; ?>" /></a>

Note the class is denoted as "lightbox". I almost positive that you will have to include that. I noticed in your code that you had the "rel" attribute denoted as lightbox, but I believe it should be class.

Best regards,

Brian

Sign in to reply to this post

roger391472

Thanks for the replies Jason and Brian.

OK, here's what I did in the code:

<div id="lft_photo2_thumb"><a href="new_prod_image_large/<?php echo $row_rs_tech_page['new_prod_photo2']; ?>" rel="lightbox" ><img src="new_prod_thumb/<?php echo $row_rs_tech_page['prod_thumb2']; ?>" name="new_prod_thumb_2" width="120" height="80" border="0" id="new_prod_thumb_2" /></a></div>

I think I have the same syntax as what you wrote Jason with the exception of the brackets around<new_prod_image_large> which I'm assuming you were using to point out the need for me to change the data. I tried it both ways just in case but it didn't make any difference. I also tried it the same way Brian has Playful Pooch with slashes I.E. /new_prod_image_large/

Brian - I also tried changing it to class instead of rel and that didn't have any effect either. One thing about that is that I noticed on Playfull Pooch site that you're using the newer "gallery" version of Lightbox but I'm using the old single photo version so would that make a difference?

With the code above I get a 404 error and the photo filename is passed to the url so it appears like this: 2eTrendCoatedlifterFord-calloutLR_2.jpg

As always your help is appreciated.

thanks,

Roger

Sign in to reply to this post

Jason ByrnesWebAssist

It's difficult to say what is wrong without being able top see the page in a browser.

If you could post it live and send a URL so we can take a look, we could probably see fairly quickly what is going wrong.

Sign in to reply to this post

roger391472

Hi Jason,

Ya, I know but I'm still developing on my local server and it's going to be a little while before I can upload it. If you don't mind I did notice that I didn't post the "lightbox" script in the first post so it would be great if you could see if it helps by seeing that. I would try to display them in another way but I need to figure out this link deal since I'm going to be using similar coding for a web link on the page too so I need to get the whole href with a dynamic data thing resolved.

Here's the other display for the web link first:
<div id="new_prod_weblink"><a href="<?php echo $row_rs_tech_page['new_prod_web']; ?>"</a></div>

When I try to use this code it the code hinting says I'm missing a closing bracket or quote and I haven't been able to find the correct syntax for that either.

Here's the lightbox script:
<script src="Scripts/AC_RunActiveContent.js" type="text/javascript"></script>
<link rel="stylesheet" href="lightbox.css" type="text/css" media="screen" />
<script type="text/javascript" src="lightbox/lightbox.js"></script>

lightbox.js is in the lightbox folder so I think I have that correct but not sure.

And here's the link code as I have it now by using your suggested code.

<div id="lft_photo2_thumb"><a href="new_prod_image_large/<?php echo $row_rs_tech_page['new_prod_photo2'];?>" rel="lightbox" ><img src="new_prod_thumb/<?php echo $row_rs_tech_page['prod_thumb2']; ?>" name="new_prod_thumb_2" width="120" height="80" border="0" id="new_prod_thumb_2" /></a></div>

Sorry to bother you with this since it's not really webassist related but I tried to do it on the lightbox forum but their registration isn't sending a confirmation e-mail and the administrator won't respond so I can't even post it there. This might make a good tutorial though since web searches have turned up almost nothing about making dynamic data a link.

Thanks,

Roger

Sign in to reply to this post

Jason ByrnesWebAssist

Without being able to see the problem in a browser it is impossible to tell what is wrong.

The code snippet you posted:

<div id="new_prod_weblink"><a href="<?php echo $row_rs_tech_page['new_prod_web']; ?>"</a></div>



should be:

<div id="new_prod_weblink"><a href="<?php echo $row_rs_tech_page['new_prod_web']; ?>">link text</a></div>




for the rest, I really do not have enough information to be able to offer assistance. being able to see the issue in a browser is crucial to figuring out the problem.

Sign in to reply to this post

roger391472

Hi Jason,

OK, thanks for taking a look at it.

That fixed the web site link question.

thanks,

Roger

Sign in to reply to this post

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...