jpflana
Posts: 13
|
| Posted: 01/05/2006, 10:03 AM |
|
I'm working on a photo gallery and have staightened most of the kinks but now I'm having HREF problems. In my first trial I manually entered a pathname in my database and the thumbnail's "Href Source" pointed to that for the picture link. Through past posts I figured out how to add my path (gallery/) in front of the image's "SRC" instead of having the path saved in the database. Now I can't figure out how to make the link's HREF work without manually saving the path in the database.
In the Href Source you either have to put in a static address (which won't work for multiple records) or link to a database field. Is there any way to combine the two and add a "gallery/" in front of the database field result?
Here's the ASP generated code to access the database.
gallery_thumb.Page = Recordset.Fields("photo_id")
I'd rather find out a solution in CCS instead of having to hardcode a fix every time, but if that's what I need to do, please help me with the code.
Thanks.
|
 |
 |
DonB
|
| Posted: 01/05/2006, 8:39 PM |
|
Set the Link to have the Data Source type of "Database Expression", then put
in a 'concatenated' string using the syntax of your particular database.
For MySQL it would be
CONCAT('gallery/',photo_id) AS photo_id
for others it may be (or some variation of)
'gallery/' + photo_id AS photo_id.
--
DonB
http://www.gotodon.com/ccbth
"jpflana" <jpflana@forum.codecharge> wrote in message
news:243bd5f89f01cf@news.codecharge.com...
> I'm working on a photo gallery and have staightened most of the kinks but
now
> I'm having HREF problems. In my first trial I manually entered a
pathname in
> my database and the thumbnail's "Href Source" pointed to that for the
picture
> link. Through past posts I figured out how to add my path (gallery/) in
front
> of the image's "SRC" instead of having the path saved in the database.
Now I
> can't figure out how to make the link's HREF work without manually saving
the
> path in the database.
>
> In the Href Source you either have to put in a static address (which won't
work
> for multiple records) or link to a database field. Is there any way to
combine
> the two and add a "gallery/" in front of the database field result?
>
> Here's the ASP generated code to access the database.
>
> gallery_thumb.Page = Recordset.Fields("photo_id")
>
> I'd rather find out a solution in CCS instead of having to hardcode a fix
every
> time, but if that's what I need to do, please help me with the code.
>
> Thanks.
> ---------------------------------------
> Sent from YesSoftware forum
> http://forums.codecharge.com/
>
|
|
|
 |
|