By ambientdrup on
On a Drupal 5.x site with CCK 5x.1.6 installed, and ImageField 5.1.2rc1, I have an imagefield in one of my content types. The image uploads to the content without issue but how can I link the uploaded image to an external URL? This can be done using the TinyMCE text editor, but I don't see this functionality built-in to the ImageField widget in CCK. Can you add a URL to the image when you upload with ImageField?
Any help is most appreciated!!
Thanks,
-backdrifting
Comments
i don't believe imagefield
i don't believe imagefield does this by default, you can make it work that way by theming it to display that way. The easiest way would be to use the contemplate module.
===
"Give a man a fish and you feed him for a day.
Teach a man to fish and you feed him for a lifetime." -- Lao Tzu
"God helps those who help themselves." -- Benjamin Franklin
"Search is your best friend." -- Worldfallz
Thanks ...
Thanks for the suggestion. Yes, I have contemplate installed and I have a template on that content type. Any further suggestions on where I should look for the theming code I'll need?
-backdrifting
in the template textboxes
in the template textboxes you should see all the fields referenced from that content type. you need to grab the imagefield you want, then manually create the link, something like:
The somewhat tricky part is going to be to get the img part path correct.
===
"Give a man a fish and you feed him for a day.
Teach a man to fish and you feed him for a lifetime." -- Lao Tzu
"God helps those who help themselves." -- Benjamin Franklin
"Search is your best friend." -- Worldfallz
You should be able to get
You should be able to get the path easily by adding the base path and using filepath:
doh... MUCH better, lol. I
doh... MUCH better, lol. I lifted that code from a page where i was using an imagecache preset and totally forgot about 'filepath'.
===
"Give a man a fish and you feed him for a day.
Teach a man to fish and you feed him for a lifetime." -- Lao Tzu
"God helps those who help themselves." -- Benjamin Franklin
"Search is your best friend." -- Worldfallz
Still the way...?
Since this post is a couple years old, would you still say that this is a good way to accomplish this task ?
Steel sharpens Steel !
A simpler solution
These days, I'd recommend the Link Image Field module.