Closed (won't fix)
Project:
Token
Version:
7.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
14 Oct 2010 at 00:40 UTC
Updated:
18 Aug 2011 at 05:02 UTC
I needed to have a token today that listed several taxonomy terms for a node. Thus, I created the following module.
Dave Reid said on IRC that this would be considered as a feature for Token module itself, so I am posting the code here.
I can re-roll this as a patch, if you tell me where it should go :)
Note: I only have CVS access from at home, so it may be longer for me to make a patch that way, since I only make patches from CVS now.
| Comment | File | Size | Author |
|---|---|---|---|
| taxolist.module.txt | 1.07 KB | EvanDonovan |
Comments
Comment #1
dave reidI think it's probably best if we make it a [node:terms-all] token for D7 and [node-terms-all] token for D6 that just is a comma-delimited list of all the terms for a node and not limited.
Comment #2
EvanDonovan commented@Dave Reid: OK. The reason I limited it in my case was because I needed this for working with the Page Title module, and I didn't want to put all the terms in the Page Title.
I may have a chance to roll a 6.x patch this weekend.
Would the 7.x token patch be against core or against this module? I'm not entirely clear on which parts are where, not having developed for D7 yet.
Comment #3
ju.ri commentedThis would be a great feature! Thanks!
Comment #4
EvanDonovan commented@ju.ri: If you need this feature now, you could use the .module I attached the the original post. Just put it in a directory of its own under sites/all/modules, and add a .info file with the same name.
You might want to modify it for your use case though, by following Dave Reid's suggestion in #1, and removing the limit on # of terms.
Comment #5
ju.ri commentedThanks again! Works great with page titles.
Comment #6
EvanDonovan commented@ju.ri: Thanks! That was what my intended use case was as well, hence the limit on # of terms.
Comment #7
RobertNelsonVance commentedThis seems to be working great for me with the "Page Title" module, it takes my terms and appends them just how I told it to in "/admin/content/page_title".
However, it isn't working for me with the "Automatic Nodetitles" module. I have included "[term-list]" in the "Pattern for the title" field on "/admin/content/node-type/page", but when I save a new page, it doesn't append the terms to the node title :-(
Any thoughts?
Comment #8
RobertNelsonVance commentedhttp://drupal.org/project/token_array worked like a charm!
Comment #9
EvanDonovan commentedLeaving this open since Dave Reid in #1 had suggested that he wanted this for Token 7.x.
Comment #10
dave reidFYI http://drupal.org/project/taxonomy_entity_index provides a [node:terms] token as comma-separated term names.
This will not ever be fixed in Token module itself because of the fact that taxonomy terms are fields.