I am adding an image to a business node (ecommerce) using the node_image module. Somehow I broke the link to the larger image.
When I first installed node_image, it worked fine, but then I spent a couple of days messing around trying to get some/any slideshow module to work (without success). Something I did broke the link from the thumbnail to the large image.
The thumbnail shows fine, and both the thumbnail and the larger image are in the same directory as they should be. The problem is the link to the large image. As an example, a correct link to the large image is:
http://localhost/saffron/files/images/node/cambodia_062.jpg
but the thumbnail has this link:
http://localhost/saffron/node/files/images/node/cambodia_062.jpg
Where is the extra "/node" coming from?
The only thing I could find in other posts was to add a "/" in front of "image" like so "/image". I did this in the image module configuration and also in the node_image configuration, and it made no difference. I tried hard coding the "/" into the php that displays the thumbnail. In node_images.module, I replaced
if ($format == 'thumbs') {
$output .= '<a href="'.$image->filepath.'" rel="lightbox">'.$thumb.'</a> ';
}with
if ($format == 'thumbs') {
$output .= '<a href="/'.$image->filepath.'" rel="lightbox">'.$thumb.'</a> ';
}That eliminated the unwanted "node" from the path. unfortunately, it also eliminated the "saffron" so that the resulting link URL was
http://localhost/files/images/node/cambodia_062.jpg
I tried to undo all the changes that I made during my unsuccessful attempts to install a slideshow module, but to no avail.
Can anyone offer any insight into this problem? I would have submitted it to the node_image module support queue but it appears to be dead.
Comments
Does this problem occur with
Does this problem occur with other images on your site or just this one? I would mess with module code as little as possible (mostly for future updating purposes). If it's just this image, you know it's not a problem with the module and you can just redo the single image. My guess is that with the messing around the database got confused, and if you delete the current entry and attach it again, it will be correct.
By the way, I noticed your picture is about Cambodia. Check out my website.
www.allisonmission.com
Hi Allison, I have been in
Hi Allison, I have been in Cambodia for a year now. I like it better than Thailand, where I was for 7 mo. Maybe I'll see you here!
There is the same problem with all images that I have added with node_image. Everything was working properly before, and I don't think I changed any code that would have broken it. In the course of trying to install maybe three different slideshow scripts (trying to find one that actually worked and did what I needed), I did a lot of enabling, disabling, changing configuration, etc. of a variety of image related modules. For example, I spent a failed day and a half trying to get jquery slideshow to work (I ended up hard coding a slideshow script into page.tpl.php, which took all of 15 min. and worked fine). I expect that the problem arose from something I did, but I cannot find what it was that caused the problem.
I think I must be treating
I think I must be treating the symptom rather than the root problem with this fix, because it worked before without it, but what got it working for me now is:
Change in node_images.module,
$image->filepathtobase_path().$image->filepath. I hope this doesn't break something else.Any thoughts on what is causing this problem when it worked OK previously without the fix?