Advertising sustains the DA. Ads are hidden for members. Join today

Contributed modules documentation

Node Embed

Last updated on
30 April 2025

Node Embed (project page) provides an input filter allowing a content editor the ability to embed the rendering of nodes within the body/fields of another node.

Syntax

The input filter looks for the occurrence of [[nid:23]] within the renderable content of a node. When it is found it will load/render that node and insert that output into the content. In the Drupal 7 version, additional parameters can be passed to the theme by adding a space, then a query string after the NID, for example [[nid:23 align=left&foo=bar]]

To switch view mode you can use the argument "view_mode" in the filter tag. If you want to show the teaser view mode you would do it like this: [[nid:2 view_mode=teaser]].

Templates

In Drupal 6, embedded nodes can be rendered with the default node-[type].tpl.php as well as node-embed--default.tpl.php and node-embed--[type].tpl.php

In Drupal 7, the template patterns are node--node_embed.tpl.php and node--[type]--node_embed.tpl.php, so just like the standard node templates with --node_embed on the end. The Drupal 7 version also provides an optional node embed node display setting, which you can enable from the Manage Display tab on a content type.

Known Issues

As of 6.x-1.1, the module prevents a node from embedding itself on its own edit page. But, if an embedded node, embeds the current node it will result in an exhausted memory error. So don't do that.

Installation

  1. Unpack the node_embed folder and contents in the appropriate modules directory of your Drupal installation. Normally sites/all/modules/
  2. Enable the node_embed module on the Modules admin page (admin/modules)
  3. Next, configure your sites' text formats (admin/config/content/formats) to use the
    'Insert node' filter by selecting the Enabled Filter Insert Node.

Configuration

Under the node_embed directory, there is the 'ckeditor/NodeEmbed' directory, that will provide a tool bar plugin for ckeditor.

CKEditor Integration

To configure the plugin:

  1. Copy the NodeEmbed directory to sites/all/modules/ckeditor/plugins directory.
  2. Add lines below to ckeditor.config.js to enable NodeEmbed as a plugin:
    config.extraPlugins += (config.extraPlugins ? ',NodeEmbed' : 'NodeEmbed' );
    CKEDITOR.plugins.addExternal('NodeEmbed', Drupal.settings.ckeditor.module_path+'/plugins/NodeEmbed/');
  3. In the same file add 'NodeEmbed' to Drupal.settings.cke_toolbar_DrupalFull and/or Drupal.settings.cke_toolbar_DrupalAdvanced arrays. For example:
    ['Link','Unlink','NodeEmbed','Anchor','LinkToNode', 'LinkToMenu'].
    For more information, see http://docs.cksource.com/CKEditor_3.x/Developers_Guide/Toolbar
  4. Download and install the iframedialog CKEditor plugin and place it in sites/all/modules/ckeditor/plugins
  5. Add the NodeEmbed icon to the correct toolbar in your CKEditor Editor Appearance settings.
  6. On the same page enable the NodeEmbed and iframedialog plugins
  7. Enable the 'Insert Node' input filter for your Text Format
  8. Enable the default view 'ckeditor-node-embed' (if its not already enabled). This view provides the content of the plugin dialog box.

WYSIWYG Integration

    Node Embed implements the Wysiwyg API and can be easily integrated with Wysiwyg editors through that interface.

    To configure the plugin:

  1. Install the Node Embed Module
  2. Go to the Wysiwyg configuration page - Site Configuration -> Wysiwyg and add the node embed button to the proper profiles.
  3. Enable the default view 'ckeditor-node-embed' (if its not already enabled). This view provides the content of the plugin dialog box.
  4. That's it - you should now see the Embed node button in the editor.

Using Node Embed and Media tags

The WYSIWG integration of Media breaks the Insert Node input filter and removes its content, because the Media tags are using a simular filter tag format as Node embed. To avoid problems you need to process the Insert Node input filter before the Convert Media tags to Markup input filter.

Help improve this page

Page status: Not set

You can: