I've searched around in the issue queue for anything related, but I couldn't find anything. Let me know if I'm wrong.
My use-case requires the client to be able to click-to-edit both the title and body of nodes displayed in a views block. The title field is formatted as a link within views. In this setup, if I click the title to edit it, I briefly see an Ajax error message, and the browser follows the link to another page.
Since the link is part of the view display, it surrounds the click-to-edit formatting. The only way I could find to disable the browser from following the link was to remove its href property via jQuery when hovering over it. I'm certainly open to better ways of doing this, however.
I've attached a patch. It certainly works, I just wonder if there's a more elegant way to handle it.
| Comment | File | Size | Author |
|---|---|---|---|
| editablefields-unlink.patch | 790 bytes | rkeppner |
Comments
Comment #1
btopro commentedI was able to solve a similar issue for node reference fields and link cck fields by adding the following in a behaviors call:
This should be acceptable functionality since the purpose of clicktoedit fields is to edit them, never to follow them
Comment #2
lunk rat commentedCan you explain where to place this code? I also need this to remove links from clicktoedit node reference fields.
Thanks!
Comment #3
btopro commentedin any js file that you hook in. I think I did it in my own module to make it work.
Comment #4
socialnicheguru commentedI am getting this too
Comment #5
WorldFallz commentedJust stumbled across this, solved by adding the following to a js file in my theme:
Removes the links completely (using href="#" caused the page to jump);
As I can't think of a valid use case for allowing anchor tags in the text of an editable field, I would think the better solution would be to remove them in the theme function. But this will do for now.
Comment #6
mengi commentedPer https://drupal.org/node/2148735, 6.x is longer maintained so issue is closed. If you wish to be a maintainer of the 6.x branch please create a new issue.