<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xml:base="http://groups.drupal.org" xmlns:dc="http://purl.org/dc/elements/1.1/">
<channel>
 <title>Tokens</title>
 <link>http://groups.drupal.org/tokens</link>
 <description>Tips, techniques, and improvements for Token.module and those who use its API.</description>
 <language>en</language>
<item>
 <title>Token for the email address of the author of the comment that someone replied to</title>
 <link>http://groups.drupal.org/node/12864</link>
 <description>&lt;p&gt;Is there a token (or a way to create one) that can be used to notify the author of the comment (not of the node) that someone has replied to it?&lt;/p&gt;
&lt;div class=&quot;og_rss_groups&quot;&gt;&lt;a href=&quot;/tokens&quot;&gt;Tokens&lt;/a&gt;&lt;/div&gt;</description>
 <comments>http://groups.drupal.org/node/12864#comments</comments>
 <category domain="http://groups.drupal.org/taxonomy/term/126">comment reply</category>
 <group domain="http://groups.drupal.org/tokens">Tokens</group>
 <pubDate>Wed, 02 Jul 2008 08:36:06 +0000</pubDate>
 <dc:creator>nikita</dc:creator>
 <guid isPermaLink="false">12864 at http://groups.drupal.org</guid>
</item>
<item>
 <title>Does module exist to let site editors maintain own tokens and replacement text?</title>
 <link>http://groups.drupal.org/node/12578</link>
 <description>&lt;p&gt;I really love token module! I&#039;m especially loving it in pathauto and auto nodetitles - very powerful.&lt;/p&gt;
&lt;p&gt;Is there a module to permit site editors to create and maintain their own tokens and corresponding replacement text, either through a UI or in a text file?&lt;/p&gt;
&lt;p&gt;The site I&#039;m building needs to let editors store snippets of text which can be reused in many places. For instance we might have this in node content: &quot;McDonalds has sold [num_bugers_sold] in their history&quot;. We&#039;d need a way to edit the value for [num_bugers_sold] and have that token update wherever it&#039;s used.&lt;/p&gt;
&lt;p&gt;I understand that token.module is fully capable of this - just need to know whether a simple module exists for maintaining one&#039;s own arbitrary tokens and replacement text.&lt;/p&gt;
&lt;div class=&quot;og_rss_groups&quot;&gt;&lt;a href=&quot;/tokens&quot;&gt;Tokens&lt;/a&gt;&lt;/div&gt;</description>
 <comments>http://groups.drupal.org/node/12578#comments</comments>
 <category domain="http://groups.drupal.org/taxonomy/term/1872">tokens</category>
 <group domain="http://groups.drupal.org/tokens">Tokens</group>
 <pubDate>Thu, 19 Jun 2008 19:30:58 +0000</pubDate>
 <dc:creator>alaken</dc:creator>
 <guid isPermaLink="false">12578 at http://groups.drupal.org</guid>
</item>
<item>
 <title>tokens in node body</title>
 <link>http://groups.drupal.org/node/11865</link>
 <description>&lt;p&gt;What&#039;s the proper way to replace tokens within a node body?&lt;br /&gt;
I&#039;ve created a simple module that implements hook_token_values and&lt;br /&gt;
hook_token_list, but to use my token within a node body, I&#039;ve had to&lt;br /&gt;
implement hook_nodeapi, which doesn&#039;t seem right.&lt;/p&gt;
&lt;div class=&quot;codeblock&quot;&gt;&lt;code&gt;&lt;span style=&quot;color: #000000&quot;&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;&amp;lt;?php&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;function &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;mymodule_nodeapi&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;(&amp;amp;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$node&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$op&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$a3 &lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;= &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;null&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$a4 &lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;= &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;null&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;) {&lt;br /&gt;&amp;nbsp;&amp;nbsp; if (&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$op &lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;== &lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;alter&#039;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;) {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$node&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;body &lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;= &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;token_replace&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$node&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;body&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;);&lt;br /&gt;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;}&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;?&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/div&gt;
&lt;p&gt;How about within a template?  Is this discouraged?&lt;/p&gt;
&lt;div class=&quot;codeblock&quot;&gt;&lt;code&gt;&amp;lt;?= token_replace(&amp;#039;[my-token]&amp;#039;) ?&amp;gt;&lt;/code&gt;&lt;/div&gt;
&lt;div class=&quot;og_rss_groups&quot;&gt;&lt;a href=&quot;/tokens&quot;&gt;Tokens&lt;/a&gt;&lt;/div&gt;</description>
 <comments>http://groups.drupal.org/node/11865#comments</comments>
 <category domain="http://groups.drupal.org/taxonomy/term/5319">node body</category>
 <category domain="http://groups.drupal.org/taxonomy/term/1872">tokens</category>
 <group domain="http://groups.drupal.org/tokens">Tokens</group>
 <pubDate>Thu, 29 May 2008 23:27:01 +0000</pubDate>
 <dc:creator>cwarden</dc:creator>
 <guid isPermaLink="false">11865 at http://groups.drupal.org</guid>
</item>
<item>
 <title>Token replacement from specific vocabularies?</title>
 <link>http://groups.drupal.org/node/11788</link>
 <description>&lt;p&gt;I&#039;ve got a content type with a Name field, and 2 taxonomy vocabularies applied, one for &quot;person type&quot; and one for &quot;issue type&quot;. I&#039;m using auto node titles module, and I want to to format the titles like this&lt;/p&gt;
&lt;p&gt;[name], [person type], on [issue type]&lt;/p&gt;
&lt;p&gt;e.g.&lt;/p&gt;
&lt;p&gt;Andy Laken, Volunteer, on Governance&lt;/p&gt;
&lt;p&gt;But in the replacement pattern list, I find only [term] which is the &quot;Name of top taxonomy term&quot; (not sure what that means.) My question - is there any way to get a replacement pattern to grab the name of the term for a specific vocabularies, when more than one vocab applies to a node?&lt;/p&gt;
&lt;p&gt;Many thanks for any help...&lt;/p&gt;
&lt;div class=&quot;og_rss_groups&quot;&gt;&lt;a href=&quot;/tokens&quot;&gt;Tokens&lt;/a&gt;&lt;/div&gt;</description>
 <comments>http://groups.drupal.org/node/11788#comments</comments>
 <group domain="http://groups.drupal.org/tokens">Tokens</group>
 <pubDate>Tue, 27 May 2008 22:36:58 +0000</pubDate>
 <dc:creator>alaken</dc:creator>
 <guid isPermaLink="false">11788 at http://groups.drupal.org</guid>
</item>
<item>
 <title>Replacement Patterns Not Available</title>
 <link>http://groups.drupal.org/node/10763</link>
 <description>&lt;p&gt;Greetings,&lt;br /&gt;
I&#039;m new to this group and to the Token module, so forgive my ignorance with this question.  Its possible I missed something basic.  I am unable to see and replacement patterns anywhere on my site where they should be listed.  For example the Auto Nodetitles module provides a fieldset which is supposed to list the available replacement patterns, but there isn&#039;t anything in the fieldset (attachment1). Its also not replacing my [field_event-raw] with anything. I have the same issue in the Workflow-ng pages, nothing shows up (attachment2), but my tokens ARE being replaced.&lt;/p&gt;
&lt;p&gt;Did I miss something in settings?  I&#039;ve tried removing token and reinstalling it but nothing changed.  Any help would be appreciated.&lt;/p&gt;
&lt;p&gt;~greg&lt;/p&gt;
&lt;div class=&quot;og_rss_groups&quot;&gt;&lt;a href=&quot;/tokens&quot;&gt;Tokens&lt;/a&gt;&lt;/div&gt;</description>
 <comments>http://groups.drupal.org/node/10763#comments</comments>
 <enclosure url="http://groups.drupal.org/files/patterns1.jpg" length="53101" type="image/jpeg" />
 <group domain="http://groups.drupal.org/tokens">Tokens</group>
 <pubDate>Wed, 16 Apr 2008 15:49:48 +0000</pubDate>
 <dc:creator>gregrenner</dc:creator>
 <guid isPermaLink="false">10763 at http://groups.drupal.org</guid>
</item>
<item>
 <title>5.x-1.11 Pre-release Bug Tracking Wiki</title>
 <link>http://groups.drupal.org/node/10741</link>
 <description>&lt;p&gt;Howdy folks,&lt;/p&gt;
&lt;p&gt;I think (and &lt;a href=&quot;http://drupal.org/node/206649#comment-808817&quot;&gt;karen thinks&lt;/a&gt;) that we&#039;ve hit the time for a 5.x-1.11 release.  Are there any major bugs we should fix prior to that release?  Can anyone else confirm that the 5.x-1.x-dev release is working well for them (I use it on all my sites, but I don&#039;t exercise all of its features...)  Post links to the issues in this wiki or as comments on this page.  If you think it&#039;s ready to go, posting a message saying that would help as well!  Thanks!&lt;/p&gt;
&lt;p&gt;(note: please don&#039;t add features, neither Mike nor Eaton nor I have time for features right now.  If you want to get a feature committed, the best way to get it committed is to review the code or have someone else review the code.)&lt;/p&gt;
&lt;div class=&quot;og_rss_groups&quot;&gt;&lt;a href=&quot;/tokens&quot;&gt;Tokens&lt;/a&gt;&lt;/div&gt;</description>
 <group domain="http://groups.drupal.org/tokens">Tokens</group>
 <pubDate>Tue, 15 Apr 2008 21:27:06 +0000</pubDate>
 <dc:creator>greggles</dc:creator>
 <guid isPermaLink="false">10741 at http://groups.drupal.org</guid>
</item>
<item>
 <title>Vocabulary Index paths &amp; Token</title>
 <link>http://groups.drupal.org/node/9381</link>
 <description>&lt;p&gt;Somewhere in fall 2007 I started working on &lt;a href=&quot;http://drupal.org/project/vocabindex/&quot;&gt;Vocabulary Index&lt;/a&gt;. The 1.0 version has been available for some weeks now and I have already started working on 2.0 (although a final won&#039;t be released for a few months. It&#039;s mostly brainstorming at this time).&lt;/p&gt;
&lt;p&gt;A short explanation of what the module does: It provides term listings for the vocabularies you want them provided for. For every vocab you can specify a path at which this term listing (the &#039;index page&#039;) will be accessible. Some kind of a taxonomy browser/business directory module, you might say.&lt;/p&gt;
&lt;p&gt;I was a bit curious whether people think it&#039;s a good move to implement Tokens for the 2.0 release or not. On the one hand it does make Vocabindex more flexible. After all, creating paths to index pages will become a little easier, especially when vocabulary data changes: If you&#039;re using [title] for the path, the path could automatically be updated as soon as the vocab&#039;s title is changed. On the other hand all those tokens creates a bit of a mess of the admin pages and I&#039;m trying to make the module as user-friendly as possible as I&#039;m a usability freak.&lt;/p&gt;
&lt;p&gt;So, the dilemma: Token implementation or not? I&#039;d like to hear some opinions on this before actually starting development. Do you think it&#039;s necessary or do you vote for usability? This is not only a discussion about this module, but perhaps a general discussion about usability versus flexibility as well.&lt;/p&gt;
&lt;div class=&quot;og_rss_groups&quot;&gt;&lt;a href=&quot;/usability&quot;&gt;Usability&lt;/a&gt;&lt;/div&gt;</description>
 <comments>http://groups.drupal.org/node/9381#comments</comments>
 <category domain="http://groups.drupal.org/taxonomy/term/4267">taxonomy browsing</category>
 <category domain="http://groups.drupal.org/taxonomy/term/4268">vocabulary index</category>
 <group domain="http://groups.drupal.org/paths">Paths</group>
 <group domain="http://groups.drupal.org/tokens">Tokens</group>
 <group domain="http://groups.drupal.org/usability">Usability</group>
 <pubDate>Tue, 04 Mar 2008 20:36:36 +0000</pubDate>
 <dc:creator>Xano</dc:creator>
 <guid isPermaLink="false">9381 at http://groups.drupal.org</guid>
</item>
<item>
 <title>format_date?  which timezone to use?</title>
 <link>http://groups.drupal.org/node/7985</link>
 <description>&lt;p&gt;There&#039;s an issue with some of the dates in tokens that they don&#039;t get set to the &lt;a href=&quot;http://drupal.org/node/198346&quot;&gt;right values&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Of course, the question is what&#039;s the &quot;right&quot; value?&lt;/p&gt;
&lt;p&gt;I&#039;m writing here to ask if you&#039;d rather get the server time or the default site time or the user&#039;s timezone.&lt;/p&gt;
&lt;p&gt;The first person who asks for &quot;configurable by the token admin&quot; will get stabbed with a &quot;work on &lt;a href=&quot;http://groups.drupal.org/node/5744&quot;&gt;token2.x&lt;/a&gt; where attributes are possible&quot;-spoon.  (yes, a spoon, it will hurt more).&lt;/p&gt;
&lt;div class=&quot;og_rss_groups&quot;&gt;&lt;a href=&quot;/tokens&quot;&gt;Tokens&lt;/a&gt;&lt;/div&gt;</description>
 <comments>http://groups.drupal.org/node/7985#comments</comments>
 <group domain="http://groups.drupal.org/tokens">Tokens</group>
 <pubDate>Sat, 05 Jan 2008 10:37:09 +0000</pubDate>
 <dc:creator>greggles</dc:creator>
 <guid isPermaLink="false">7985 at http://groups.drupal.org</guid>
</item>
<item>
 <title>Arbitary tokens</title>
 <link>http://groups.drupal.org/node/7419</link>
 <description>&lt;p&gt;In the last two days I whipped up a &lt;em&gt;very&lt;/em&gt; quick module that allows you to create arbitrary tokens (i.e. /node/add/token) for use with the token modules. This was primarily created for use with the tokenize module so that through the UI a user could create tokens and select which fields could use those tokens.&lt;/p&gt;
&lt;p&gt;The tokens are nodes which could cause some serious performance issues under certain conditions. In our environment there were none (or any anticipated) performance issues as the number of users using the set of modules was low. I used node_load to grab the content of the tokens for replacement which means that the PHP in the token body is executed.&lt;/p&gt;
&lt;p&gt;I&#039;ll be creating a project page/checking into CVS later this week. I just wanted to post that I created it just in case other were considering doing the same.&lt;/p&gt;
&lt;div class=&quot;og_rss_groups&quot;&gt;&lt;a href=&quot;/tokens&quot;&gt;Tokens&lt;/a&gt;&lt;/div&gt;</description>
 <comments>http://groups.drupal.org/node/7419#comments</comments>
 <group domain="http://groups.drupal.org/tokens">Tokens</group>
 <pubDate>Sat, 01 Dec 2007 18:39:46 +0000</pubDate>
 <dc:creator>jredding</dc:creator>
 <guid isPermaLink="false">7419 at http://groups.drupal.org</guid>
</item>
<item>
 <title>Token and the Rep[lacement]Tags module</title>
 <link>http://groups.drupal.org/node/7247</link>
 <description>&lt;p&gt;I&#039;m author and maintainer of the Rep[lacement]Tags module (&lt;a href=&quot;http://drupal.org/project/reptag&quot; title=&quot;http://drupal.org/project/reptag&quot;&gt;http://drupal.org/project/reptag&lt;/a&gt;). As mentioned and explained before the reptag module is a regexp-based, node-centric, bigger brother/sister of the Token module. The idea behind both modules is quite similar and even the API is similar on some points. For Drupal 6 I&#039;d really love to see the modules complement each other (or even merge). To achieve that (at least for most of the features) only a few changes to Token and some more to Reptag ;) would be required.&lt;/p&gt;
&lt;p&gt;Basically Reptag could provide two things to complement Token:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;The UI to manage tags (add/edit/remove) online from the admin pages&lt;/li&gt;
&lt;li&gt;A simple (yet powerful) plug-in system, so called .tags modules in reptag&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;I have posted a request to the issue queue a week ago which explains more details: &lt;a href=&quot;http://drupal.org/node/141430#comment-619523&quot; title=&quot;http://drupal.org/node/141430#comment-619523&quot;&gt;http://drupal.org/node/141430#comment-619523&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;For a developers perspective on reptag&#039;s api you can read &lt;a href=&quot;http://cvs.drupal.org/viewvc.py/drupal/contributions/modules/reptag/DEVELOPER.txt?revision=1.11&quot;&gt;DEVELOPER.txt&lt;/a&gt; or try the module yourself to get an impression.&lt;/p&gt;
&lt;p&gt;Regards Thilo&lt;/p&gt;
&lt;div class=&quot;og_rss_groups&quot;&gt;&lt;a href=&quot;/tokens&quot;&gt;Tokens&lt;/a&gt;&lt;/div&gt;</description>
 <comments>http://groups.drupal.org/node/7247#comments</comments>
 <group domain="http://groups.drupal.org/tokens">Tokens</group>
 <pubDate>Wed, 21 Nov 2007 11:50:00 +0000</pubDate>
 <dc:creator>profix898</dc:creator>
 <guid isPermaLink="false">7247 at http://groups.drupal.org</guid>
</item>
<item>
 <title>Modules that Use Token Module</title>
 <link>http://groups.drupal.org/node/6795</link>
 <description>&lt;p&gt;Here is a list of some of the modules that use token.  If you know of another, please add it.&lt;/p&gt;
&lt;p&gt;Some of these modules provide tokens, some just use the token_replace mechanism.  But if you are looking for something that will integrate nicely with (for example) Auto Node Title, Page Title, or Pathauto (the consumers of tokens) then you should consider these modules which will probably expose their inner data as tokens to other modules.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;http://drupal.org/project/ecommerce&quot;&gt;ecommerce like ec_mail&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://drupal.org/project/custom_breadcrumbs&quot;&gt;Custom Breadcrumbs&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://drupal.org/project/og&quot;&gt;Organic Groups - og&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://drupal.org/project/auto_nodetitle&quot;&gt;Automatic Nodetitles (aka auto_nodetitle)&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://drupal.org/project/pathauto&quot;&gt;Pathauto&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://drupal.org/project/uploadpath&quot;&gt;Upload Path&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://drupal.org/project/pressflow_placement&quot;&gt;PressFlow Placement&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://drupal.org/project/ubercart&quot;&gt;Ubercart&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://drupal.org/project/invite&quot;&gt;Invite&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://drupal.org/project/tokenize&quot;&gt;Tokenize&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://drupal.org/project/audio&quot;&gt;Audio&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://drupal.org/project/workflow_ng&quot;&gt;Workflow-ng&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://drupal.org/project/cck_taxonomy&quot;&gt;CCK Taxonomy&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://drupal.org/project/cck_fullname&quot;&gt;CCK Full Name&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://drupal.org/project/cck_taxonomy_ssu&quot;&gt;CCK Taxonomy SSU (Super Select Ultra)&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://drupal.org/project/fieldset_menus&quot;&gt;Fieldset Menus&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://drupal.org/project/relativity&quot;&gt;Node Relativity&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://drupal.org/project/backup_migrate&quot;&gt;Backup and Migrate&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://drupal.org/project/user_stats&quot;&gt;User stats&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://drupal.org/project/simplefeed&quot;&gt;Simplefeed&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://drupal.org/project/page_title&quot;&gt;Page title&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://drupal.org/project/tokennodetokens&quot;&gt;Token Node Tokens (TNT)&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://drupal.org/project/temporary_invitation&quot;&gt;Temporary Invitation&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://drupal.org/project/activity&quot;&gt;Activity&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://drupal.org/project/type_local_nids&quot;&gt;Type-local nids&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://drupal.org/project/filefield&quot;&gt;FileField&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://drupal.org/project/actions_token_email&quot;&gt;Actions Token Email for 5.x&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;div class=&quot;og_rss_groups&quot;&gt;&lt;a href=&quot;/tokens&quot;&gt;Tokens&lt;/a&gt;&lt;/div&gt;</description>
 <group domain="http://groups.drupal.org/tokens">Tokens</group>
 <pubDate>Sun, 28 Oct 2007 15:23:12 +0000</pubDate>
 <dc:creator>greggles</dc:creator>
 <guid isPermaLink="false">6795 at http://groups.drupal.org</guid>
</item>
<item>
 <title>Another token enhancement proposal</title>
 <link>http://groups.drupal.org/node/6675</link>
 <description>&lt;p&gt;Token should probably provide an easy way for modules to create tokens based on already existing tokens. Let me explain what I mean. For a node, I should be able to pass in &#039;author-&#039; as a prefix, &#039;user&#039; as the type, and the node&#039;s author as the object. Token would then get all the values for &#039;user&#039; with the object $user, and would return them as the tokens [author-usertokenpropertyhere]. This could be used by many modules: nodes could create tokens for their organic groups as [og-nodeproperty], buddylist could create tokens for the user&#039;s buddies as [buddylist-userproperty], and nodes could create tokens for their terms as [tax-taxonomyproperty].&lt;/p&gt;
&lt;p&gt;Token would have to check to make sure that we are not caught in an infinite loop (node calls its organic group, which calls its organic group, which calls its organic group, etc., or node calls its author, which calls its most recent post, which calls its author, etc). In some case recursiveness could be useful (node calls organic group which calls author), but it would have to make sure that the same property isn&#039;t being called twice.&lt;/p&gt;
&lt;p&gt;Admittedly, this would cause performance declines- however, if it becomes possible to disable certain tokens that are not used, it would stop being a performance problem and start being an optional feature that would increase the power of token and the modules that use it.&lt;/p&gt;
&lt;p&gt;This would be a highly useful feature, and many modules would be able to take advantage of this. There are countless ways where nodes, users, taxonomy items, comments, etc. interact, and this property would allow the token module to make use of these interactions.&lt;/p&gt;
&lt;div class=&quot;og_rss_groups&quot;&gt;&lt;a href=&quot;/tokens&quot;&gt;Tokens&lt;/a&gt;&lt;/div&gt;</description>
 <comments>http://groups.drupal.org/node/6675#comments</comments>
 <group domain="http://groups.drupal.org/tokens">Tokens</group>
 <pubDate>Sun, 21 Oct 2007 01:13:09 +0000</pubDate>
 <dc:creator>cwgordon7@drupal.org</dc:creator>
 <guid isPermaLink="false">6675 at http://groups.drupal.org</guid>
</item>
<item>
 <title>Token enhancement proposal</title>
 <link>http://groups.drupal.org/node/5744</link>
 <description>&lt;p&gt;Token is great, however there are still some problems that need to be solved. Here is a proposal, which tries to do so.&lt;/p&gt;
&lt;p&gt;Problems I noticed are:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;missing handling of multiple values&lt;/li&gt;
&lt;li&gt;no way to get tokens of a certain node type and no more&lt;/li&gt;
&lt;li&gt;no way to get token help for only raw values or formatted ones - which might lead to XSS created by unexperienced users&lt;/li&gt;
&lt;li&gt;performance: getting all token values for a node takes about 10ms!&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;I ran over the performance issue while developing workflow-ng. I think 10ms just for replacing a token is far less than ideal. I noticed that user tokens are working quite fast, so I assume that getting and caching &lt;em&gt;all&lt;/em&gt; token values takes that long. So I propose to do the replacing in two steps, first off it is determined for each token, if it has been used.Then on the second step, the value for each used token is determined and replaced.&lt;br /&gt;
So token needs to get only the values for really use tokens - this should work fast!&lt;/p&gt;
&lt;p&gt;Unfortunately, this and the improved formatter handling requires API changes. So consider this as a proposal for token 2.x.&lt;/p&gt;
&lt;p&gt;Here are more details:&lt;/p&gt;
&lt;h3&gt;This is how the token list could look like&lt;/h3&gt;
&lt;div class=&quot;codeblock&quot;&gt;&lt;code&gt;&lt;span style=&quot;color: #000000&quot;&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;&amp;lt;?php&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #FF8000&quot;&gt;/**&lt;br /&gt; * Implementation of hook_token_list()&lt;br /&gt; */&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;function &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;node_token_list&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;() {&lt;br /&gt;&amp;nbsp; return array(&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; array(&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;#entity&#039; &lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;=&amp;gt; &lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;node&#039;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;,&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;#name&#039; &lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;=&amp;gt; &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;t&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;content&#039;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;),&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;#types&#039; &lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;=&amp;gt; array(&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;page&#039;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;story&#039;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;),&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;nid&#039; &lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;=&amp;gt; array(&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;#label&#039; &lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;=&amp;gt; &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;t&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;label..&#039;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;)),&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;title&#039; &lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;=&amp;gt; array(&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;#label&#039; &lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;=&amp;gt; &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;t&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;content title&#039;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;), &lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;#formatter =&amp;gt; array(&#039;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;plain&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;)),&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; .....&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ),&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; array(&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &#039;&lt;/span&gt;&lt;span style=&quot;color: #FF8000&quot;&gt;#entity&#039; =&amp;gt; &#039;my_own&#039;,&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;label&#039; &lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;=&amp;gt; array(&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;#label&#039; &lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;=&amp;gt; &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;t&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;label..&#039;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;)),&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ...&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ),&lt;br /&gt;&amp;nbsp; );&lt;br /&gt;}&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;?&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/div&gt;
&lt;p&gt;A #formatter &#039;raw&#039; is per default available and has to be supported by each token. Then I thought of this properties for a token:&lt;br /&gt;
 # label - for the help&lt;br /&gt;
 # formatter - any further available (except from raw)&lt;br /&gt;
 # multiple - If there are multiple values, e.g. for CCK multiple fields or user roles.&lt;/p&gt;
&lt;p&gt;Note that I&#039;ve used &quot;entity&quot; instead of object, so it&#039;s more clear that arrays are supported too.&lt;/p&gt;
&lt;h3&gt;Token values&lt;/h3&gt;
&lt;p&gt;Then the hook_token_values implement needs to be changed. It could look like this:&lt;/p&gt;
&lt;div class=&quot;codeblock&quot;&gt;&lt;code&gt;&lt;span style=&quot;color: #000000&quot;&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;&amp;lt;?php&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #FF8000&quot;&gt;/**&lt;br /&gt; * Simple example implementation of hook_token_values()&lt;br /&gt; **/&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;/&lt;br /&gt;function &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;node_token_values&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$token_info&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$entity &lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;= &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;NULL&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;) {&lt;br /&gt;&amp;nbsp; return &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$token_info&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;#formatter&#039;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;] == &lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;raw&#039; &lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;? &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$entity&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;-&amp;gt;{&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$token_info&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;#name&#039;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;]} : &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;check_plain&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$entity&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;-&amp;gt;{&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$token_info&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;#name&#039;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;]});&lt;br /&gt;}&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #FF8000&quot;&gt;/*&lt;br /&gt;format of $token_info:&lt;br /&gt;$token_info = array(&lt;br /&gt;&amp;nbsp; &#039;#entity&#039; =&amp;gt; &#039;node&#039;,&lt;br /&gt;&amp;nbsp; &#039;#types&#039; =&amp;gt; array(&#039;page&#039;),&lt;br /&gt;&amp;nbsp; &#039;#name&#039; =&amp;gt; &#039;nid&#039;,&lt;br /&gt;&amp;nbsp; &#039;#formatter&#039; =&amp;gt; &#039;raw&#039;, /(&#039;plain&#039;, or whatever specified)&lt;br /&gt;);&lt;br /&gt; */&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;?&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/div&gt;
&lt;h3&gt;Token help&lt;/h3&gt;
&lt;div class=&quot;codeblock&quot;&gt;&lt;code&gt;&lt;span style=&quot;color: #000000&quot;&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;&amp;lt;?php&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;function &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;theme_token_help&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$selection &lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;= array(), &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$formatter &lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;= &lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;raw&#039;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$prefix &lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;= &lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;[&#039;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$suffix &lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;= &lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;]&#039;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;, ) {&lt;br /&gt; &lt;/span&gt;&lt;span style=&quot;color: #FF8000&quot;&gt;//get the token lists, merge together the definitions for same entities, cache this -&amp;gt; (in an extra funciton)&lt;br /&gt; //then go for the selection and render the help&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;}&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;?&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/div&gt;
&lt;p&gt;e.g. usage theme(&#039;token_help&#039;, array(&#039;global&#039;, &#039;my_own&#039;, &#039;node&#039; =&amp;gt; array(#types =&amp;gt; array(&#039;page&#039;))&lt;br /&gt;
or just theme(&#039;token_help&#039;, array(&#039;global&#039;, &#039;my_own&#039;, &#039;node&#039;) to get all node tokens.&lt;/p&gt;
&lt;p&gt;default tokens would be [content:title] or [my_own:label].&lt;br /&gt;
for theme(&#039;token_help&#039;, array(&#039;node&#039;)) the tokens would be only like this: [title]&lt;/p&gt;
&lt;p&gt;$formatter may be &#039;raw&#039;, &#039;all&#039; or &#039;formatted&#039;. &#039;formatted&#039; means all formatters but raw.&lt;br /&gt;
So if multiple formatters are available for one token the replacements would be:&lt;br /&gt;
[content:date:year] or [content:date:short]&lt;/p&gt;
&lt;h3&gt;multiple fields handling&lt;/h3&gt;
&lt;p&gt;Consider [content:textfield] to be a mutiple textfield.&lt;/p&gt;
&lt;p&gt;[content:textfield] should return an appropriate replacement for &lt;em&gt;all&lt;/em&gt; textfields, e.g. comma separated.&lt;br /&gt;
[content:textfield][2] should return only the second textfield, if exists.&lt;/p&gt;
&lt;p&gt;Of course, we would have to add the information of the required field to $token_info, so that the module can return the appropriate value.&lt;/p&gt;
&lt;h3&gt;enhanced entity handling&lt;/h3&gt;
&lt;p&gt;Often there are &quot;foreign keys&quot; which point to another entities, e.g. $node-&amp;gt;uid or CCK node and user reference fields.&lt;br /&gt;
So, if one wants to use the user tokens for an author, currently we have to re-add all the user token definitions.&lt;br /&gt;
To avoid this I propose to make it possible to specify related entities.&lt;/p&gt;
&lt;p&gt;Example node author:&lt;/p&gt;
&lt;div class=&quot;codeblock&quot;&gt;&lt;code&gt;&lt;span style=&quot;color: #000000&quot;&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;&amp;lt;?php&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #FF8000&quot;&gt;/**&lt;br /&gt; * Implementation of hook_token_list()&lt;br /&gt; **/&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;/&lt;br /&gt;function &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;node_token_list&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;() {&lt;br /&gt;&amp;nbsp; return array(&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; array(&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;#entity&#039; &lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;=&amp;gt; &lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;node&#039;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;,&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;#name&#039; &lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;=&amp;gt; &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;t&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;content&#039;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;),&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;nid&#039; &lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;=&amp;gt; array(&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;#label&#039; &lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;=&amp;gt; &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;t&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;label..&#039;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;)),&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;author&#039; &lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;=&amp;gt; array(&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;#entity&#039; &lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;=&amp;gt; &lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;user&#039;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;#label&#039; &lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;=&amp;gt; &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;t&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;Content author&#039;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;)),&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; .....&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ),&lt;br /&gt;&amp;nbsp; );&lt;br /&gt;}&lt;/p&gt;
&lt;p&gt;&lt;/span&gt;&lt;span style=&quot;color: #FF8000&quot;&gt;//When token tries to get the value, it has first to get the node author entity:&lt;/p&gt;
&lt;p&gt;//Implementation of hook_token_values()&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;function &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;node_token_values&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$token_info&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$entity &lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;= &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;NULL&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;) {&lt;br /&gt;&amp;nbsp; if (&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$token_info&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;#name&#039;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;] == &lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;author&#039;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;) {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; return &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;user_load&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;(array(&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;uid&#039; &lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;=&amp;gt; &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$entitiy&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;uid&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;));&lt;br /&gt;&amp;nbsp; }&lt;br /&gt;&amp;nbsp; return &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$token_info&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;#formatter&#039;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;] == &lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;raw&#039; &lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;? &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$entity&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;-&amp;gt;{&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$token_info&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;#name&#039;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;]} : &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;check_plain&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$entity&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;-&amp;gt;{&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$token_info&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;#name&#039;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;]});&lt;br /&gt;}&lt;/p&gt;
&lt;p&gt;&lt;/span&gt;&lt;span style=&quot;color: #FF8000&quot;&gt;//Then it can get the value as usual.&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;?&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/div&gt;
&lt;p&gt;The token help would have to include all user tokens for a node. They could be used e.g.&lt;br /&gt;
by using [content:author:mail].&lt;/p&gt;
&lt;h3&gt;callbacks&lt;/h3&gt;
&lt;p&gt;We could also go for callbacks instead of the hook_token_values. I think this way the code could get even a bit more cleaner and we save some time invoking the hook.&lt;/p&gt;
&lt;div class=&quot;codeblock&quot;&gt;&lt;code&gt;&lt;span style=&quot;color: #000000&quot;&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;&amp;lt;?php&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #FF8000&quot;&gt;/**&lt;br /&gt; * Implementation of hook_token_list()&lt;br /&gt; */&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;function &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;node_token_list&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;() {&lt;br /&gt;&amp;nbsp; return array(&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; array(&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;#entity&#039; &lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;=&amp;gt; &lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;node&#039;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;,&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;#name&#039; &lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;=&amp;gt; &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;t&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;content&#039;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;),&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;#types&#039; &lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;=&amp;gt; array(&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;page&#039;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;story&#039;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;),&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;nid&#039; &lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;=&amp;gt; array(&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;#label&#039; &lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;=&amp;gt; &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;t&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;label..&#039;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;), &lt;/span&gt;&lt;span style=&quot;color: #FF8000&quot;&gt;#callback =&amp;gt; &#039;node_token_values&#039;),&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;title&#039; &lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;=&amp;gt; array(&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;#label&#039; &lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;=&amp;gt; &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;t&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;content title&#039;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;), &lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;#formatter =&amp;gt; array(&#039;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;plain&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;), #callback =&amp;gt; &#039;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;node_token_values&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;),&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; .....&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ),&lt;br /&gt;&amp;nbsp; );&lt;br /&gt;}&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;?&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/div&gt;
&lt;p&gt;Opinions?&lt;br /&gt;
I could go for implementing the changes, however I think I would need some help converting all the actual token hook implementations.&lt;/p&gt;
&lt;div class=&quot;og_rss_groups&quot;&gt;&lt;a href=&quot;/tokens&quot;&gt;Tokens&lt;/a&gt;&lt;/div&gt;</description>
 <comments>http://groups.drupal.org/node/5744#comments</comments>
 <group domain="http://groups.drupal.org/tokens">Tokens</group>
 <pubDate>Tue, 21 Aug 2007 08:48:29 +0000</pubDate>
 <dc:creator>fago@drupal.org</dc:creator>
 <guid isPermaLink="false">5744 at http://groups.drupal.org</guid>
</item>
<item>
 <title>Barcelona Event</title>
 <link>http://groups.drupal.org/node/5442</link>
 <description>&lt;p&gt;Following Dries&#039; request for more presentations I decided that Token module would be a good topic:&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://barcelona2007.drupalcon.org/node/416&quot;&gt;Token Module: How I Learned To Use the Token API and Stop Re-Implementing Dynamic String Replacement&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;So, if you are headed to Barcelona and want to learn more about using Tokens, this would be a great session to attend.  Similarly, we plan to use some of the time to talk about the &quot;future of tokens&quot; which should hopefully be a useful topic.&lt;/p&gt;
&lt;div class=&quot;og_rss_groups&quot;&gt;&lt;a href=&quot;/tokens&quot;&gt;Tokens&lt;/a&gt;&lt;/div&gt;</description>
 <comments>http://groups.drupal.org/node/5442#comments</comments>
 <category domain="http://groups.drupal.org/taxonomy/term/1872">tokens</category>
 <group domain="http://groups.drupal.org/tokens">Tokens</group>
 <pubDate>Sat, 04 Aug 2007 14:54:50 +0000</pubDate>
 <dc:creator>greggles</dc:creator>
 <guid isPermaLink="false">5442 at http://groups.drupal.org</guid>
</item>
<item>
 <title>The future of tokens?</title>
 <link>http://groups.drupal.org/node/3830</link>
 <description>&lt;p&gt;Wow. Pathauto finally made the move!&lt;/p&gt;
&lt;p&gt;Token module was conceived when I was writing custom_breadcrumbs and custom_links, and wanted to generate the kind of simple [foo] and [bar] links that had been popularized by Pathauto. I was &lt;em&gt;this&lt;/em&gt; close to listing pathauto as a dependency for both modules when I ran into greggles in #drupal and started chatting with him about the need for a centralized &#039;Just The Tokens&#039; utility that many modules could benefit from.&lt;/p&gt;
&lt;p&gt;With the current release of Token module, and the current release of Pathauto, quite a few modules can now plug into &quot;the system.&quot;&lt;/p&gt;
&lt;p&gt;Now, though, with more modules using the tokens in more scenarios, problems are beginning to appear that we didn&#039;t anticipate. Tokens, it appears, are not JUST about a snippet of text and a description. More information, like the current language. Metadata ABOUT tokens (like whether a given token is url-safe, html-safe, completely unfiltered, etc) and so on are all part of the mix. In addition, some ideas that have been kicked around include dynamic generation of tokens -- parsing the substitution text for tokens and replacing only the ones needed, rather than generating ALL tokens and looking to see if they appear. Indeed, the entire &#039;context&#039; system that token currently uses may be unnecessarily limiting. Should tokens appear as [node:title] and [user:name] rather than simply [title] and [name]?&lt;/p&gt;
&lt;p&gt;It&#039;s time to start brainstorming. How can token.module&#039;s relative simplicity be preserved while supporting the flexibility that more modules will want?&lt;/p&gt;
&lt;div class=&quot;og_rss_groups&quot;&gt;&lt;a href=&quot;/tokens&quot;&gt;Tokens&lt;/a&gt;&lt;/div&gt;</description>
 <comments>http://groups.drupal.org/node/3830#comments</comments>
 <group domain="http://groups.drupal.org/tokens">Tokens</group>
 <pubDate>Fri, 27 Apr 2007 04:39:00 +0000</pubDate>
 <dc:creator>eaton@drupal.org</dc:creator>
 <guid isPermaLink="false">3830 at http://groups.drupal.org</guid>
</item>
</channel>
</rss>
