0

I want to do this: If I enter a body in content type, on save the content type body searched and automatically link to exists node title.

As example :
body: The drupal is one of best CMS systems,

If I have a node with title "drupal" I want the drupal link to it automatically on save, is there any module to do this? If not appreciate any idea help me to implement it.

I found Alinks module, it similar to what I want but It not link to existing nodes, it just link to some user defined word and links.

The main problem is searching for existing node title not linking to them, we have body with many word,I want if a word equal node title that exist , it link to it

1
  • do you found a way?
    – user25884
    Apr 8, 2014 at 12:14

1 Answer 1

1

You may consider the FreeLinking module.

The Freelinking module adds a text filter for using Wiki-style markup for creating links automatically, by searching the node body for markup. It supports a number of methods for creating the link, including Nodetitle (which sounds like the one you're looking for). You may even add methods by adding your own link plugin.

However, you need to indicate the text you want to be considered as a candidate for automatic linking by markup: i.e. by surrounding it with double square brackets. This is how your example will look like:

The [[drupal]] is one of best CMS systems

It even lets you create placeholder links to pages that has not been created yet. Both internal and external links are supported by the module.

There tutorial is about using the Freelinking module, with a little help from the companion WikiTools module, here.

If the way Freelinking does this is not good enough for you, here are a couple of alternative solutions:

Alternative solution #1: You can write your own custom text filter for this. I suspect that to create something that works during node saves without freezing or killing your site will be very hard to do.

Alternative solution #2: If you can accept a solution that delays the creation of links, you can place new and altered links in a queue, and then use a cron job to parse them for links. This allows you to space out the parsing of node bodies over time and will avoid the performance problems a real-time text filter would create. For the record: There exists no module that does the parsing of node bodies and add links like this. You'll need to write it yourself.

6
  • Hannemeyr, tnx for your attention, you first part of answer is good,but my problem is searching for exist tile in body, you thing I have 20000 node and body with 3000 world, what is your suggestion to search ? I want something like rule_autotag but search in titles,
    – Yuseferi
    Apr 6, 2014 at 6:48
  • The main problem is searching for existing node title not linking to them, we have body with many world,I want if a word equal node title that exist , it link to it
    – Yuseferi
    Apr 6, 2014 at 6:49
  • Searching for all the 3000 words in a node body the a dictionary that consistst of 20000 node titles upon saving a node is very resource demanding and it probaly will kill your site. If this is the functionality you want, I can't think of a simple way of doing it. I'll offered a couple of alternate suggestions tho'. Apr 6, 2014 at 9:15
  • tnx for your suggestion and tnx for your great module , but I mentioned in my question,I want they linked automatically without I do, because I dont know all title of my nodes.
    – Yuseferi
    Apr 6, 2014 at 9:18
  • I have another way,I will use combination of your module and rule_autotag module,in node_save, I add title to my custom vocab and exract them with rule_autotag api ,then replace founded tags in body with your module features,
    – Yuseferi
    Apr 6, 2014 at 9:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.