Made to Order Software Corporation Logo

Insert Node Usage

Syntax

The Insert node tag syntax is:

   [node:<name of node> <parameters>]

Name of node

The <name of node> can either be

  • The name of the node, i.e. it's URL without the protocol and domain1, or
  • The node identifier (the number you see in your URL when you edit the node), or
  • An asterisk (*) in which case the current node applies2 (6-1.2).

As pointed out by one of our users, the asterisk can be used to create macros.

Parameters

All the <parameters> are optional. Since version 6-1.1, some parameters accept a value (i.e. cck, link, more, etc.) This is defined as:

   <parameter>=<value>;3

It is expected that each parameter is used at most once. However, it is valid to specify the same parameter twice (as in "title body title" to include the title before and after the body.) For some parameters (i.e. collapsed, demote, etc.), only the last instance is taken in account.

By default, not including any parameters that add content is similar to using content (see below.) However, the default uses a separate theme and therefore it can be made different by overloading the theme named InsertNode_default.

In Drupal 5, you can only specify one parameter. And the collapsible option automatically includes the body.

In itself, the order of the parameters is not important. However, in most cases it defines the order in which you want the data to be displayed. So if you want the title, teaser and more link in that order, you must enter them in that order as in:

   [node:article41 title teaser more]

Final Output

Once the output was generated, it is themed one last time using the InsertNode_node theme.

The default InsertNode_node theme adds one more <span> or <div> around the output and includes three classes:

  1. insert-node
  2. insert-node<count>
  3. insert-nid<node-nid>

These classes can be used to create advanced CSS output specific to a node or an entry insert on another page.

A <span> is used if the Insert Node inserts only <span> or no tags. Otherwise, a <div> is used.

NOTE

The version defined between parenthesis in the list below shows the time when the given parameter appeared. Parameters that were available in 5-1.0 are still available in 6-1.2, for instance. When a parameter changed in some way, it is indicated in its definition.

The parameters that are marked as [no content] do not insert any content and thus do not affect the insertion of the "default" data. In other words, if you only used parameters that are marked [no content], you will get the "default".

  • 1. For instance, to insert this very node, I would use the name doc_insert_node_usage.
  • 2. The asterisk is useful to repeat something from the node in a block. This could be the title of the node or a CCK field. I would suggest you avoid using the body of the current node in a block!
  • 3. It is important to note that the value ends with a semi-colon and it cannot itself include a semi-colon.