Adding a URL link custom field?
how to
Version: 2.26
URL:
|
lex
Member Usergroup: Member Joined: May 26, 2005 Total Topics: 6 Total Posts: 16 |
Posted 10/13/05 - 11:12 AM:
I want to be able to add a custom field in which the user inputs a URL to be linked with the photo. How do I do that. If it makes more sense. Its for a client that has stock plans (house) in PDF format and we want to have it so when you go to the gallery you see a main JPG of the stock plan and the ability to add a link to the PDF file for download. Any ideas will be well appreciated. Thanks |
|
Paul
developer Usergroup: Administrator Joined: Dec 20, 2001 Location: Diamond Springs, California Total Topics: 65 Total Posts: 7614 |
Posted 10/15/05 - 10:25 PM:
Use HTML to create links. <a href="{TEMPLATEVAR}">link</a>. Use the template variable which it tells you when you add the field. |
|
lex
Member Usergroup: Member Joined: May 26, 2005 Total Topics: 6 Total Posts: 16 |
Posted 10/16/05 - 1:38 PM:
Thanks WORKED!!!!! |
|
ryanmw2002
Member Usergroup: Customer Joined: Mar 31, 2008 Total Topics: 4 Total Posts: 12 |
Posted 09/07/08 - 6:46 PM:
Would you be able to expound on how you do this exactly? Where would you put this html code at? For example, I figured out how to add the field when submitting an image. However, I want it to be where I click on an image in the gallery, it goes to the enlarged image as normal. And then when I click on it again it should go to the linked site (from link field). Thanks! Edited by ryanmw2002 on 09/07/08 - 7:13 PM |
|
Paul
developer Usergroup: Administrator Joined: Dec 20, 2001 Location: Diamond Springs, California Total Topics: 65 Total Posts: 7614 |
Posted 09/09/08 - 5:59 AM:
Not sure which level of enlargement you mean. When you view a category you click a thumbnail to see a larger image, and then you can click another time to see the full-size image by itself. If you mean after step 2, the image details (aka details and comments, depending on switches selected) template can be edited to link to the URL. If you mean after step 3, that's just a download of the image itself so you'll want to edit the image details page to link to a custom template which includes the full size image linked to the external site. If you name the template fullsize.tpl, then in the image details template you would replace <IF {SHOWREDUCED} is yes> with <IF {SHOWREDUCED} is yes>and fullsize.tpl would be <a href="{IMAGEURLFIELD}"><img src="{IMAGEDOWNLOADURL}"></a>Edited by Paul on 09/09/08 - 6:03 AM |
|
ryanmw2002
Member Usergroup: Customer Joined: Mar 31, 2008 Total Topics: 4 Total Posts: 12 |
Posted 09/10/08 - 6:14 PM:
Here is an example of what I want to happen. Step 1: Someone attaches an image and then types WWW.GOOGLE.COM in the new custom link field (IMAGEURLFIELD), then submits. Step 2: They go to the gallery, click on the thumbnail of their image, see their image in the details and comments page. Step 3: They then click on the image in the details and comments page, and are then transferred to www.google.com. (preferably in a new window if possible) I have reverted my templates back to default and started over. I did as you posted above but maybe I am not insterting the new (IMAGEURLFIELD) correctly. This goes into the Suggest Image template correct? I just kind of plopped it in there randomly. <IF {IMAGENUMATTACHMENTS}> |
|
Paul
developer Usergroup: Administrator Joined: Dec 20, 2001 Location: Diamond Springs, California Total Topics: 65 Total Posts: 7614 |
Posted 09/11/08 - 3:42 PM:
You want the link at step 2, then. Go to the image details template as described above and change <a href="download.php?attachid={ATTACHID}&id={IMAGEID}"> to <a href="{IMAGEURLFIELD}"> Remove the changes you made to the suggest image template. When you add a field, it automatically places the code in the 'custom image fields' template. If you want to change where it displays, copy and paste it out of there to the desired location in the suggest image and edit image templates. |
|
ryanmw2002
Member Usergroup: Customer Joined: Mar 31, 2008 Total Topics: 4 Total Posts: 12 |
Posted 09/11/08 - 6:34 PM:
That's exactly what I was looking for!!!!! Thanks! |
|
||
This thread is closed, so you cannot post a reply.

Print