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.
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).
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> <a href="download.php?attachid={ATTACHID}&id={IMAGEID}"><img src="download.php?<IF not {EDIT}>width={PROPERWIDTH}&height={PROPERHEIGHT}&</IF>attachid={ATTACHID}&id={IMAGEID}&edit={EDIT}&action={ACTION}&useedit={USEEDIT}" alt="{IMAGEBOOKMARKTITLE}" border="0"></a> <OTHERWISE> <img src="download.php?attachid={ATTACHID}&id={IMAGEID}&edit={EDIT}&action={ACTION}&useedit={USEEDIT}" alt="{IMAGEBOOKMARKTITLE}"> </IF>
with
<IF {SHOWREDUCED} is yes> <a href="link.php?action=detail&id={IMAGEID}&custom=yes&TID=fullsize"><img src="download.php?<IF not {EDIT}>width={PROPERWIDTH}&height={PROPERHEIGHT}&</IF>attachid={ATTACHID}&id={IMAGEID}&edit={EDIT}&action={ACTION}&useedit={USEEDIT}" alt="{IMAGEBOOKMARKTITLE}" border="0"></a> <OTHERWISE> <a href="link.php?action=detail&id={IMAGEID}&custom=yes&TID=fullsize"><img src="download.php?attachid={ATTACHID}&id={IMAGEID}&edit={EDIT}&action={ACTION}&useedit={USEEDIT}" alt="{IMAGEBOOKMARKTITLE}"></a> </IF>
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}> <br />Current Attachments:<br /> <!-- BEGIN LINK ATTACHMENTS --> <input type="checkbox" name="attachdelete[]" value="{ATTACHID}" /> {ATTACHFILETITLE} ({ATTACHKB} KB)<br /> <!-- END LINK ATTACHMENTS --> <input type="submit" name="attachdeletion" value="Delete Selected" class="button" /> </IF> </td> </tr> </IF>
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.
Comments on Adding a URL link custom field?
Member
Usergroup: Member
Joined: May 26, 2005
Total Topics: 6
Total Comments: 16
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
developer
Usergroup: Administrator
Joined: Dec 20, 2001
Location: Diamond Springs, California
Total Topics: 61
Total Comments: 7868
Use HTML to create links. <a href="{TEMPLATEVAR}">link</a>. Use the template variable which it tells you when you add the field.
Member
Usergroup: Member
Joined: May 26, 2005
Total Topics: 6
Total Comments: 16
Thanks WORKED!!!!!
Member
Usergroup: Customer
Joined: Mar 31, 2008
Total Topics: 4
Total Comments: 12
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!
developer
Usergroup: Administrator
Joined: Dec 20, 2001
Location: Diamond Springs, California
Total Topics: 61
Total Comments: 7868
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 with
and fullsize.tpl would be
Member
Usergroup: Customer
Joined: Mar 31, 2008
Total Topics: 4
Total Comments: 12
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.
developer
Usergroup: Administrator
Joined: Dec 20, 2001
Location: Diamond Springs, California
Total Topics: 61
Total Comments: 7868
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.
Member
Usergroup: Customer
Joined: Mar 31, 2008
Total Topics: 4
Total Comments: 12
That's exactly what I was looking for!!!!! Thanks!