This module creates a filter allowing user to attach everything inline with a simple tag.

The purpose is to provide a "light" presentation, and link to heavy content (ie., with attach_node, then link to full node view, with attach_flash or attach_audio, then link to a lightbox style popup...).

It solves also the caching problem. For example, when a poll is embedded, even if the node content is cached with filter, the poll is fetched using AJAX and allows anyone to cast a vote. The mechanism is similar to Ajax Blocks, however it happens inside the node content.

Bonus: other than Drupal normal contents (entities), Attach also support 3rd party contents (can be configured per format) like Slideshare, Twitter, iframe, or any media (YouTube, Vimeo, Twitter etc. if the MediaWrapper library is present).

Features

  • This module is extensible with plugins using Drupal hook mechanism.
  • Each plugin has two mode: simple mode or full mode (default).
    In simple mode, a minimal text is used and is inserted into node content inside a SPAN tag. In the full mode, a DIV is used and renders more data.

Quick start

  • Enable this module
  • Go to the input format settings page and turn on the Attach filter
  • Enjoy the attach syntax in your node content

A few examples:

  • [attach_node|nid=1]
  • [attach_node|nid=12|simple=1]
  • [attach_user|uid=1]
  • [attach_flv|file=files/movie.flv]
  • [attach_twitter|id=1234567890]

Integration

This module supports: author_pane, fancybox, lightbox... (I'm adding many more).

If you're using the core HTML Corrector filter, put more weight on the attach filter. HTML Corrector is known to strip JS escapes and this bug has not been fixed in core: #222926: HTML Corrector filter escapes HTML comments.

Security

For better performance, the attach module allow node content to be cacheable. There is no access control on the embedded node, so pay attention not to put any sensitive information in the node teaser.

Project information

Releases