Last updated 5 August 2009. Created on 1 November 2008.
Edited by Roi Danton, gustav. Log in to edit this page.

[#id] [#id,option(s)] [#id,option(s) comment]

Linodef is an input filter for embedding content of your Drupal installation (Drupal objects) into any textarea and link to it. The tags are based exclusively on object IDs which enables a highly dynamic usage. So links won't break and the embedded content stays up to date. Editor buttons help users by finding their desired object and inserting the corresponding Linodef tag.

Application field

Linodef is useful when you have a text that needs to include references to other Drupal objects or contains content which is already available in other objects. Some examples:

  • You write an article that refers to things you've already saved as node or taxonomy term or you want to quote news/other articles (yes, you can dynamically embed whole texts, with or without linking them).
  • You write a thesis with many difficult terms (the spelling of some of them will change likely) and you require (1) a common spelling as well as (2) links to an explanation for yourself and your readers (each term is a node or taxonomy term).
  • You write a book and you expect that names of characters will change during the writing process (each character has a node with fields for firstname, nickname, surname etc).
  • You have a forum and your users want to link to other threads and include their titles in a simple manner.

This is only an incomplete list of examples. Drupal object filters are applicable in many more cases than those.

Comparison to Inline API

Inline API will provide a framework for modules to add tag replacements while Linodef uses its own functions. Both approaches have up- and downsides. Inline could feature more Drupal objects in future due to third party modules while Linodef has a clearer tag layout and allows the creation of object lists for an easy tag insertion. In future we should utilize the features of both projects together.

Tag layout
  • Options: Both use key=value pairs. Linodef uses double quotes for values to allow using almost all 8-bit characters (except double quotes - no escaping of this character featured yet).
  • Option separator: Inline uses | and Linodef ,.
  • Object identifier: Linodef uses the object ID and a tag option [#id,identifier] while Inline will use a key=value pair depending on the inline type.
Tag insertion
Linodef uses object lists (as editor buttons or with RC4 also as blocks) while Inline provides a framework for modules to do this. I.e. with Linodef an admin can create buttons (with views or a certain object type) and with Inline a module developer can do this.
Handle faulty user inserted tags
Linodef uses the Drupal message system to submit detailed tag errors and warnings. In Inline this support is currently very rough.

Comparison to other Drupal object filter modules

To achieve the required flexibility the ID of a node, ID of a term and optionally a fieldname are the only elements that are saved within your text. The other data is included on-the-fly. That is the difference to similar filter modules that uses node names to create links (wiki-like behavior) or that limit their tags to the Node ID, too, but do not embed anything else. Following is a list of advantages the method Linodef uses has:

  • if you change the title or field value of the linked node then the title or field value are updated in your text automatically
  • if you change the name of a term then the name is updated in your text automatically
  • if the node or term has a path alias then that is used instead of the default /node and /term path (if you change it, it is updated too)
  • links don't break even if you change the title of a linked node or the name of a linked taxonomy term
  • the tag layout is hardcoded and thus reliable so other modules can work with those tags
  • the tag syntax is extensible due to tag options i.e. in the future more object types can be supported without the need for a syntax change
  • you may use tag comments to flag your tags for other editors and yourself
  • a tag validation system sends messages to the text and/or the Drupal message system so the user knows if he entered a tag with a wrong syntax and knows how to correct this (optional, messages can be deactivated)
  • buttons are provided which ease the selection and inclusion of tags

The german version of this documentation included into the module is paused since RC2 until final release due to more important tasks.

Looking for support? Visit the forums, or join #drupal-support in IRC.