Closed (works as designed)
Project:
Insert
Version:
7.x-1.x-dev
Component:
User interface
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
6 Mar 2014 at 11:23 UTC
Updated:
13 Sep 2018 at 14:05 UTC
Jump to comment: Most recent
Comments
Comment #1
hectorplus commentedComment #2
shadowxx commentedI'm also looking for that feature ;)
Comment #3
davidneedhamThis may be obvious, but you'll have to link the image manually after inserting it. If you're creating a new node and you don't know what the URL is going to be, you may have to save the node first, copy the URL, and then create the link on the image.
Annoying, but I personally don't think it's something that should be within the insert module itself. Still, patches welcome. If you (or anyone happening across this) adds the functionality to make it work, post here so others can benefit.
Comment #4
snater commentedI am browsing trough old issues while working on the module's D8 version. First I thought about picking this up for D8, but then again, I am not really convinced.
It would very well be possible to have Insert insert a placeholder link that is replaced when processing the node form. But that would require an option right next to the Insert button whether to Insert the image with a link to the node or without, as probably not all images shall link to the node. I think the relatively rare use-case of linking an image to the node does not justify always having an option in such a prominent place. So, one could argue about having a field setting on whether to include that option at the Insert button, but an option whether to allow setting an option just does not seem right…
Another solution would be to have a sub-module duplicating each existing style with the same style, but the duplicated style's template including the placeholder link. (This would be similar to how the colorbox module extends Insert.) But I think this would tend to create a messy style list for such a small feature.
Regardless, it is possible to solve that with a custom module providing a custom style to Insert. A custom module would need to implement
hook_insert_stylesto provide the style label andhook_insert_contentthat would aggregate and return the template generated for that style. An example of such hook implementations can be seen ininsert/includes/insert.inc. The custom style would insert a placeholder link through its own template. Hooks likehook_node_insertandhook_node_updatecould be used to replace the placeholder.It would of course also be possible to implement the custom module in the way the colorbox module does, as described above.
Since I am not convinced of that being a major use-case, I will close the issue as "works as designed", unless any objection arises.
Comment #5
snater commentedAs per last comment.