Chris@0: /** Chris@0: * Implements hook_token_info(). Chris@0: */ Chris@0: function {{ machine_name }}_token_info() { Chris@0: $type = array( Chris@0: 'name' => t('Nodes'), Chris@0: 'description' => t('Tokens related to individual nodes.'), Chris@0: 'needs-data' => 'node', Chris@0: ); Chris@0: Chris@0: // Core tokens for nodes. Chris@0: $node['nid'] = array( Chris@0: 'name' => t("Node ID"), Chris@0: 'description' => t("The unique ID of the node."), Chris@0: ); Chris@0: $node['title'] = array( Chris@0: 'name' => t("Title"), Chris@0: 'description' => t("The title of the node."), Chris@0: ); Chris@0: $node['edit-url'] = array( Chris@0: 'name' => t("Edit URL"), Chris@0: 'description' => t("The URL of the node's edit page."), Chris@0: ); Chris@0: Chris@0: // Chained tokens for nodes. Chris@0: $node['created'] = array( Chris@0: 'name' => t("Date created"), Chris@0: 'description' => t("The date the node was posted."), Chris@0: 'type' => 'date', Chris@0: ); Chris@0: $node['author'] = array( Chris@0: 'name' => t("Author"), Chris@0: 'description' => t("The author of the node."), Chris@0: 'type' => 'user', Chris@0: ); Chris@0: Chris@0: return array( Chris@0: 'types' => array('node' => $type), Chris@0: 'tokens' => array('node' => $node), Chris@0: ); Chris@0: }