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.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

WorldFallz’s picture

Status: Active » Postponed (maintainer needs more info)

it 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.

Greg Boggs’s picture

WorldFallz, 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.

WorldFallz’s picture

thanks 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.

WorldFallz’s picture

Status: Postponed (maintainer needs more info) » Active
ivars211’s picture

leewoodman’s picture

Apologies for the subscribe +1. It would be great to get this functionality in to exclude current nid.

leewoodman’s picture

Can anyone give me a pointer on this one and i'll attempt a patch for it?

leewoodman’s picture

Status: Active » Needs review
FileSize
2.86 KB

Go gentle on me this is my first Drupal patch. It's not pretty but i think it works.

WorldFallz’s picture

Status: Needs review » Needs work

@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...

WorldFallz’s picture

Looks 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 :-(.

andrewdchancox@googlemail.com’s picture

If anyone wants it I wrote a bit of javascript to remove recursive links from views:

    jQuery('div.views-row').each(function(index, value){
        var titlelink = jQuery(value).find('div.views-field-title span.field-content a').first();
        var title = titlelink.html();
        jQuery(value).find('div.views-field-body a:contains("' + title + '")').replaceWith(title);
    });
jfalkner’s picture

While waiting for this to be implemented at a code level, the following CSS seems to work fine for my purposes:

a.glossify-link.active {
    color:inherit;
    /* Added !important to make IE10+ behave */
    pointer-events:none!important;
    cursor:default!important;
}
a.glossify-link.active > img.info-icon {
    display:none;
}

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.

  • Drupal 7
  • Glossify 7.x-4.0-beta1+15-dev
silvi.addweb’s picture

Status: Needs work » Needs review
FileSize
1.39 KB

Attached patch removes self linking for nodes. I have checked with views and its working fine.

sanduhrs’s picture

Version: 7.x-4.x-dev » 2.0.x-dev
sanduhrs’s picture

Version: 2.0.x-dev » 3.x-dev
sanduhrs’s picture

Category: Support request » Feature request
Status: Needs review » Needs work