Author |
Topic |
|
chrisredco
VP-CART Super User
282 Posts |
Posted - March 18 2010 : 09:44:26
|
I am updating the Body Main COntent section of my 7.0 upgrade site, and have uploaded my image to that part of the page. Is there a way I can make that image also have a hyperlink? Since the field referencing the image is just a field in Admin, I'm not sure where I would add a hyperlink to this part of the page. |
|
carfin
VP-CART Expert
United Kingdom
948 Posts |
Posted - March 18 2010 : 12:00:44
|
Hi,
although I'm not familiar with V7, you will most likely have to open shopcontent.asp in a text or html editor and find the following sub:
Sub formatimage (image) Response.write "<p class=""ac"">" response.write "<img border=""0"" src=""" & image & """ alt="" "" />" response.write "</p>" end sub
add your response.write"<a href=""link details etc etc"">" within this routine.
This will give you a hyperlink but it will be the same for each content record image, unless you add a check eg "if content record=whatever" then response.write"<a href........>"
I hope this helps
Regards,
Carrol www.deanston-electrical.co.uk |
Edited by - carfin on March 18 2010 12:04:17 |
|
|
chrisredco
VP-CART Super User
282 Posts |
Posted - March 18 2010 : 15:26:16
|
Thanks, but that didin't seem to work. Here is the way to make this happen, as per the fine folks at tech support:
To add a link to the image, please try the following steps:
1. Open tmp_default.htm that located under "/templates/default-3cols" (or default-2cols)folder using text editor (eg. Notepad).
2. Locate the following code: (around line 6)
$ <img src="[ContentImage]" align="right" alt="" class="image" />
3. Change it into the following code:
$ <a href="your_redirected_page.asp"><img src="[ContentImage]" align="right" alt="" class="image" /></a>
4. Save the file and check your website to see the changes. |
|
|
carfin
VP-CART Expert
United Kingdom
948 Posts |
Posted - March 19 2010 : 05:54:27
|
Glad you got it sorted. You didn't say that it was only the home page content you wanted to add the image link to which is why I went for shopcontent.asp instead of tmp_default.htm
For anyone else looking for an easy way through the admin panel to add a hyperlink to the image in the image field of any of your content records, here's how:
In your content records use the other 2 field to add the address of the page you want the image to link to. Open shopcontent.asp in an html or text editor Find sub formatimage Replace the code up to and including the end sub line with the following:
Sub formatimage (image) dim imageurl imageurl=crs("other2") Response.write "<p class=""ac"">" If imageurl="" then response.write "<img border=""0"" src=""" & image & """ alt="" "" />" response.write "</p>" else response.write "<a href=""" & imageurl & """ >" response.write "<img border=""0"" src=""" & image & """ alt="" "" />" response.write "</a></p>" end if end sub
Save the file
I've tested this and it works fine
Regards,
Carrol www.deanston-electrical.co.uk |
|
|
chrisredco
VP-CART Super User
282 Posts |
Posted - March 20 2010 : 08:51:53
|
Nice! Sorry I was less than exact in my post. This is a great tool to know about.
Thanks again, Chris |
|
|
|
Topic |
|