Made to Order Software Corporation Logo

Insert Nodes used as a macro (6.x-1.2)

This module can be used to create macros (as pointed out by one of our user in a Drupal issue.)

The following steps show you how you can create a macro with the Insert Node module.

Create the Macro

First, create a node that is to become the macro. We will call this node macro. It is used without the Insert Node filter so the Insert Node tags do not get changed. This is important since we reference the main node (with the asterisk) and that reference would look like a recursive reference.

One idea is to use the macro as a PayPal button which gets set with parameters from another node. This means you create a PayPal form with different <input> tags and expect the Insert Node to fill in the data.

  <input name="item_name" type="hidden" value="[node:* cck=title; plain]" />

Repeat these entries as required (cost, ISBN, etc.)

Once ready, save the macro. This node, by itself, will not work for end users. Whenever easily done on your system, hide the Insert Node from your users.

Use the Macro

Now, we create another node that is to use the macro. That new node includes the macro with the following tag:

  [node:macro cck=body; repeat]

The repeat parameter ensures that what is being included is itself re-parsed by the Insert Node filter (by default it isn't since we expect the child node to already have been filtered by Insert Node, but remember, in our case, that is not the case!)

Save this node and see the result! The node CCK fields appear in your macro fields!

See Also

Insert Node Usage

Insert Node Parameter: cck (6-1.2)

Insert Node Parameter: plain (6-1.2) [no content]

Insert Node Parameter: repeat (6-1.2) [no content]