The Token module needs to be integrated so that a skeleton can be created, but have various tokens applied at run time. Users should be able to insert the base tokens provided by Token in the node and global context. As well, users should be able to specify additional tokens which appear as fields to fill in during the creation of a Skeleton instance.

The use case in this instance is where users need to be able to specify items such as a dealer name, location, or links to other nodes (such as a location node).

Comments

agentrickard’s picture

Awesome idea.

deviantintegral’s picture

Status: Active » Needs review
StatusFileSize
new21.65 KB

Here is a patch which does the following:

  1. Adds a "Token" tab to the skeleton interface, where custom tokens are listed and can be added, edited, and deleted. Each token is simply a token paired with a description.
  2. When editing a template, the available tokens are in collapsed fieldsets above the title. Tokens can be used in the Title and Body fields.
  3. When creating a skeleton instance, the node body and title are scanned for custom tokens. Any tokens which are used are added in a new "Skeleton tokens" fieldset to be filled in. These tokens are then passed in to the submit function and applied to the title and body fields. Skeleton tokens are replaced before node tokens, so you can do things like set the title to "Services by [dealer-name]" and then reference the [title] tag in the node body.

This should add quite a bit of flexibility to templates, allowing one outline to be easily customized. Also, Token is now a module requirement as there is a required database table.

deviantintegral’s picture

StatusFileSize
new21.28 KB

Here is an updated patch which applies cleanly against head. I changes how the description of custom tokens is check_plain'ed, instead storing the unescaped version in the database. It also renames 'All tokens' to 'Node tokens'.

deviantintegral’s picture

Status: Needs review » Fixed

Committed to HEAD.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.