Hello,

This is probably not an issue, just me doing something wrong, but I 've searched through google and can't find any other reference to this...

I have linkit 7.x-2.1 installed with CKEditor 3.6.1.7072 and Wysiwyg 7.x-2.1

The linkit plugin button enabled without problem. I click on it and get the modal form.

  • Enter a node title and autocomplete displays a table with nodes
  • I select a node ( e.g. "test linkit" and its url is shown in the adress field underneath it. (e.g. /drupal/node/20)
  • I confirm the entry and CKEditor enters : <a href="/drupal/node/20">drupal/node/20</a> in the body of my document

I would expect to see <a href="/drupal/node/20">test linkit</a> here.

I looked through Wysiwyg, CKeditor configurations and linkit profiles and searched the net if there was some setting for this but didn't find any.
Is it normal that the url is displayed instead of the title ?

Many thanks,
Leo

Comments

anon’s picture

Do you have a "selection" before you click the linkit button?

If not, this is how it supposed to be I think.

If you have a selection, that will become the "click text"

LeoDoms’s picture

Thanks for the response.
The behaviour described above is what happens without a selection. If a piece of text is selected, it turns into a link, so that is as expected.

If, without a selection, the title in the "search" field is indeed ignored by the plugin when it creates the link then I'll communicate this to our client and see if he can live with it or if we need to make some kind of customisation ourselves. I just need to make sure that this is indeed the way that linkit enters links in this case, and check if no one else has had the same idea and found a way to use the title .

Thanks
Leo

anon’s picture

Status: Active » Closed (fixed)
fietserwin’s picture

Status: Closed (fixed) » Active

I think that Linkit should insert link text with somewhat more intelligently than it does now. In the case where there's a;ready a selction made, it is simple: the selection is turned into a link. If not, it is Linkit who decides what text is placed between the anchor tags. I find it completely reasonable when users expect this text to be more than the path part of the URL.

For links to nodes, logical candidates are the node title or the text or description of the(/a) menu item referring to the node. For terms it is the term name or perhaps the term description. For users, it is their name. For images it might be their alt or title text stored in the(/a) image field referring to that image. Etc.

This looks like an additional field in your popup window with a - configurable - default filling as soon as a link has been selected from the auto-complete interface. This configuration should be part of the config page and could be token based.

anon’s picture

I think we should go for the entity label, which is title for nodes, name for user and so on. In that way its feels kind of generic I think and will also supports other entities that might use Linkit.

fietserwin’s picture

Yes, perhaps better to keep it simple. So no token based algorithms (perhaps in the far future :)).

anon’s picture

Maybe if there is an alter function for this, as other devs can use to change the behavior.

anon’s picture

Status: Active » Fixed

I have commited a fix for this now.

Its uses the result title (the text you actually select in the BAC result list) as the link text if there is no other selection.

See commit http://drupalcode.org/project/linkit.git/commit/d4053c3

fietserwin’s picture

Thanks (and that is for all your quick reactions)! I will give it a try later today.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.