Using the Views Theme Wizard, I generated the template for a view that included a CCK image field.

I'm not sure if this is intentional, but the variable output for the image ($field_image_nid_label) contained a full link to the image, e.g. <a href="/imagename">imagename</a></pre>

I actually want to make a hyperlink based on the image, so to make this useful, I will have to strip it back and reformat it as <a href="http://www.somecompany.com"><img src="/files/images/imagename" /></a>.

It would be better if $field_image_nid_label just contained the image name, so we can do with it what we will.

Comments

merlinofchaos’s picture

Project: Views (for Drupal 7) » ImageField
Version: 4.7.x-1.5 » 5.x-1.x-dev

Probably the views info for that field type could use an option? not sure the best way to deal with this.

quicksketch’s picture

Title: Theme Wizard produces inconsistent variable » Create formatter including only image path

The solution here would be to provide a formatter which just returns the image path rather than an img tag.

dopry’s picture

It may be cool to create some sort of imagefield_extras.module along the lines of views bonus pack that has some cool formatters and widgets for imagefield... opinions?

dopry’s picture

Version: 5.x-1.x-dev » 6.x-3.x-dev
Category: bug » feature
dopry’s picture

Status: Active » Closed (fixed)

totally in 2.x and head.