Concept

This module provides an input filter which allows for the automatic insertion of properties/field values from any entity present on the site. The idea behind this module is to ensure that text referencing an entity is updated when the entity is updated.

For example, say a link is included within a block of text to a user that wrote the block of text, the standard way of doing this would be to include the following:

With thanks to <a href="/user/1234">Debbie Dallas</a> for her contribution to this page.

If Debbie gets married and changes her name/username, then this link will not be correct. The solution is to provide the text dynamically:

With thanks to <a href="/user/1234">[entity:user:1234]</a> for her contribution to this page.

How to

Enable the module, and add the filter to any input formats you would like to use it with. The module looks for the following pattern within a block of text:
[entity:{entity type}:{entity ID}(:{field/property - Optional, defaults to label})]
e.g.:

  • [entity:user:151544] would be converted to "sdrycroft" on this site
  • [entity:node:1:title] would be converted to "About Drupal" on this site

CKEditor plugin

The 7.x-1.x-dev release of this module includes a plugin for CKEditor that autocompletes input into the text area. The user can start typing, for example [entity:user: followed by the username of a user, and the ID will be autopopulated. Using the same example above, typing [entity:user:sdr would give options of all users whose username starts with the letters sdr, selecting sdrycroft would fill out [entity:user:151544].

Project information

Releases