Currently, the image filter only provides an option to hyperlink the image to the image node itself (using the "nolink=(0|1)" flag) for viewing the enlarged version of an image.
There are situations where it would be very useful if an image could be linked to any node, rather than just its enlargement.
One example of this is using images as graphical icons to link to content pages.
I propose that a new attribute be added to the [image:x ...] filter tag as follows:
If you specify
nolink=1, no link will be created to the image node. The default is to create a link to the image.Alternatively, if you specify
node=id, a link will be created to the node with the given id.
The attached patch (applies cleanly against 4.6.x and CVS HEAD) implements this functionality as described (this is my first drupal patch submission, so be gentle ;-).
| Comment | File | Size | Author |
|---|---|---|---|
| image_filter.module_1.patch | 3.85 KB | scotto |
Comments
Comment #1
scotto commentedUnassigned this - I don't think I was supposed to assign it to myself...
If anyone has looked at this patch (its a pretty basic few-liner) I would like to know your thoughts.
Also, I'm not sure on the exact protocol for feature submissions around here, but do I need to assign this to "4.6.0" or "CVS" in the Version field? (It applies cleanly to both) Thanks.
Comment #2
bwynants commented+1 nice feature. This way I can link an image to the album containing it!
Comment #3
David Hull commentedSorry for not responding sooner. This seems like a reasonable feature, and I will integrate it in the near future.
Comment #4
astra commentedHow to use the image filter to the field_textarea of the flexinode module?
For example, I input [image:5 node=14] to a textarea field(flexinode_8), and try to make a custom theme within node-flexinode-2.tpl.php:
if using
print $contentthe image filter works well and the image can be displayed properly.
Instead of that I want to theme the fields separately and use
print $node->flexinode_8But now I get the the following dispaly without the image filtered:
[image:5 node=14]
Any solution theming to the field level of flexinode with the image filter? Thanks!
Comment #5
veelo commentedTry
when running 4.7, otherwise check out check_output.
Bastiaan Veelo.
Comment #6
veelo commentedTry
when running 4.7, otherwise check out check_output.
Bastiaan Veelo.
Comment #7
David Hull commentedPatch applied in revision 1.20.