Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
If there is a phrase that is the same as the title of the current node in the body text, it links the phrase to the current node. That looks weird.
Comment | File | Size | Author |
---|---|---|---|
#13 | node_links_to_self-2128553-13.patch | 1.39 KB | silvi.addweb |
#8 | glossify-stop-node-linking-to-itself-2128553-8783145.patch | 2.86 KB | leewoodman |
Comments
Comment #1
WorldFallz CreditAttribution: WorldFallz commentedit may look odd-- but it is technically correct. I'm not sure what's the standard functionality at large though (in other contexts, not necessarily drupal related).
i'll see if I can find some consensus on the net... in the meantime, if anyone has any examples please link them.
Comment #2
Greg BoggsWorldFallz, as a rule, a link should never point to it self. It's #10 on Nielson's list.
http://www.nngroup.com/articles/most-violated-homepage-guidelines/
You should be able to grab the URL checking code from Alinks for this feature. If current URL is the same as the target you're about to add, don't add the link.
Comment #3
WorldFallz CreditAttribution: WorldFallz commentedthanks for the ref-- that's exactly the type of info I was looking for. Makes sense too. On the todo list for the next update.
Comment #4
WorldFallz CreditAttribution: WorldFallz commentedComment #5
ivars211 CreditAttribution: ivars211 commentedDirty solution, but works:
http://stackoverflow.com/questions/9650474/clearing-a-link-with-javascri...
Comment #6
leewoodman CreditAttribution: leewoodman commentedApologies for the subscribe +1. It would be great to get this functionality in to exclude current nid.
Comment #7
leewoodman CreditAttribution: leewoodman commentedCan anyone give me a pointer on this one and i'll attempt a patch for it?
Comment #8
leewoodman CreditAttribution: leewoodman commentedGo gentle on me this is my first Drupal patch. It's not pretty but i think it works.
Comment #9
WorldFallz CreditAttribution: WorldFallz commented@leewoodman -- belated grats on your first patch and thanks for submitting!
I don't think the arg() method is going to work though. Nodes/fields with glossified terms can appear in many contexts where arg(1) will not be 'node' (panels pages, views, teasers, etc). I'll need to look into another way of checking if the link is a self-reference-- maybe in the initial query itself if possible.
if anyone has an idea please share...
Comment #10
WorldFallz CreditAttribution: WorldFallz commentedLooks like getting the self reference is going to be a large pain: #226963: Context-aware text filters (provide more meta information to the filter system). Might have to resort to js but that just feels wrong :-(.
Comment #11
andrewdchancox@googlemail.com CreditAttribution: andrewdchancox@googlemail.com commentedIf anyone wants it I wrote a bit of javascript to remove recursive links from views:
Comment #12
jfalkner CreditAttribution: jfalkner as a volunteer commentedWhile waiting for this to be implemented at a code level, the following CSS seems to work fine for my purposes:
It's not 100% cross browser compatible, but it hits enough for me to feel good with the solution, especially since my primary concern is presentational.
Comment #13
silvi.addweb CreditAttribution: silvi.addweb at AddWeb Solution Pvt. Ltd. commentedAttached patch removes self linking for nodes. I have checked with views and its working fine.
Comment #14
sanduhrsComment #15
sanduhrsComment #16
sanduhrs