How to add this link to large image?
|
Posted
#73095
(In Topic #15313)
|
|
|---|---|
|
Community saint |
On my image gallery catalog, I need to add a link to open a new window with the full-size image as shown below: The image name will be the same except that the large image will be in /uploads/catalogues/large/ instead of /uploads/catalogues/. How can I build this link dynamically? I think I need to place this code in CATALOGUE_image_galleries_ENTRY.tpl as shown below: Code
<div class="float_surrounder">
Any of you coding gurus have any tips to get me started? Thanks for any help. Bob |
|
Posted
|
|
|
Community saint |
For example, if the URL was in {FIELD_5}, you could replace {FIELD_5} with: Code
{$REPLACE,/catalogues/,/catalogues/large/,{FIELD_5}}
Do you have a Samsung Galaxy S / Galaxy S II ? If so, why not check out my ScreenFree FM Radio .
|
|
Posted
|
|
|
Community saint |
So I would use a Comcode url tag and do the replacement to the param portion? Thanks for your help. Bob |
|
Posted
|
|
|
Community saint |
This is the code that I tried: Code
[url="View large image" target="_blank"]{$REPLACE,/catalogues/,/catalogues/large/,{FIELD_5}}[/url][title]Title[/title]
I clearly have done something wrong. Any thoughts? Bob |
|
Posted
|
|
|
Community saint |
Try {FIELD_5_THUMB} or {FIELD_5_PLAIN}. I've seen code references to this type of structure, but I can't find any documentation on it
Do you have a Samsung Galaxy S / Galaxy S II ? If so, why not check out my ScreenFree FM Radio .
|
|
Posted
|
|
|
Community saint |
|
|
Posted
|
|
|
Community saint |
The path to the image is not a URL, so need to prefix it with {$BASE_URL*}/ . Put it all together, and this should do it: Code
{$COMCODE,[url="View large image" target="_blank"]{$BASE_URL*}/{$REPLACE,/catalogues/,/catalogues/large/,{FIELD_5_PLAIN}}[/url][title]Title[/title]}
Do you have a Samsung Galaxy S / Galaxy S II ? If so, why not check out my ScreenFree FM Radio .
|
|
Posted
|
|
|
Community saint |
Thanks again. Bob |
|
Posted
|
|
|
Community saint |
Do you have a Samsung Galaxy S / Galaxy S II ? If so, why not check out my ScreenFree FM Radio .
|
|
Posted
|
|
|
Community saint |
Take my advice. I'm not using it!
View my working ocPortal site (version 9.x.x) at Anglo-Indian Portal |
|
Posted
|
|
|
Community saint |
The community may not be large right now but with the kind of help given, I suspect it will be growing. Bob |
|
Posted
|
|
|
Community saint |
digiflash | Photography,Webdesign and digital art community (dutch) |
|
Posted
|
|
|
Community saint |
Bob |
|
Posted
|
|
|
Community saint |
However, for the regular member there is no corresponding image placed in /uploads/catalogues/large/. I need some way of fixing this. Either I need to copy the original image into the /uploads/catalogues/large/ at submission which seems foolish since it will be the same size as the regular submitted image. So, what I would like is to use the image in /uploads/catalogues/ viewed full-size if there is no corresponding image in /uploads/catalogues/large/. Anyone have any idea on how I might accomplish this? For reference, this is the current code in CATALOGUE_image_galleries_ENTRY.tpl: Code
{$COMCODE,[url="View large image" target="_blank"]{$BASE_URL*}/{$REPLACE,/catalogues/,/catalogues/large/,{FIELD_6_PLAIN}}[/url]}
Any help is greatly appreciated. Bob |
|
Posted
|
|
|
Community saint |
So instead of using the /uploads/catalogues/large/ custom folder for your large images you would be using a custom /uploads/catalogues/small/ folder for the thumbnails.
Do you have a Samsung Galaxy S / Galaxy S II ? If so, why not check out my ScreenFree FM Radio .
|
|
Posted
|
|
|
Community saint |
The code currently scales the images down on the page based on the thumbnail size. The images in are, in fact, larger. I set up the /uploads/catalogues/large/ folder for when I am scanning images and I want to provide an extra-large version (over 2k on the short dimension) which I populate vis FTP. The result is that the previous link works fine for any images that I upload. However, when a regular member uploads his file to /uploads/catalogues/, it is properly scaled down but there is no option to view the full-size image uploaded as is the case with my large images. That;s why I was thinking that if there is no image in /uploads/catalogues/large/, display the image in /uploads/catalogues/ in a new window at full-resolution which would mimic what happens with my large images. I think I have that right. Bob |
|
Posted
|
|
|
Community saint |
Is it physically being scaled down (i.e. the original hi-res image is deleted/replaced), or are they only being presented with the smaller image. If it is just a presentation issue then the original hi-res image should still be accessible. I had the same problem with galleries until I modified the template to present the thumbnail and provide a link to the original image.
Do you have a Samsung Galaxy S / Galaxy S II ? If so, why not check out my ScreenFree FM Radio .
|
|
Posted
|
|
|
Community saint |
They are just presented with the scaled down image. What I have been doing is copying their original uploaded images into /uploads/catalogues/large/, but that it not a practical solution as the site grows. That is why I'd like my link to present the image in /uploads/catalogues/large/ if it exists or otherwise present the unscaled original image. In both cases, the larger image needs to open in its own window which is the way the current link now works. I need to figure out how to check if the large image exists and then choose the right image to display. Bob EDIT: They are physically being scaled down. P.S. I wonder why I am not getting notifications for this thread. I see the "untracked topic" button so it seems it thinks I want notifications..
Last edit: by BobS
|
|
Posted
|
|
|
Community saint |
Why not just let all the images, including the large ones, be loaded to the default /uploads/catalogues/ and let the thumbnail be auto-generated. No manual moving required.
Do you have a Samsung Galaxy S / Galaxy S II ? If so, why not check out my ScreenFree FM Radio .
|
|
Posted
|
|
|
Community saint |
I gues I could just FTP the images into the directory and then specify them by URL. I could then change my link to just display the image in /uploads/catalogues. I think this is what you are suggesting. Bob |
1 guests and 0 members have just viewed this: None
Control functions:







Last edit: by