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.

CommentFileSizeAuthor
taxolist.module.txt1.07 KBEvanDonovan

Comments

dave reid’s picture

I 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.

EvanDonovan’s picture

@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.

ju.ri’s picture

This would be a great feature! Thanks!

EvanDonovan’s picture

@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.

ju.ri’s picture

Thanks again! Works great with page titles.

EvanDonovan’s picture

@ju.ri: Thanks! That was what my intended use case was as well, hence the limit on # of terms.

RobertNelsonVance’s picture

This 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?

RobertNelsonVance’s picture

Status: Needs review » Closed (fixed)
EvanDonovan’s picture

Version: 6.x-1.x-dev » 7.x-1.x-dev
Status: Closed (fixed) » Active

Leaving this open since Dave Reid in #1 had suggested that he wanted this for Token 7.x.

dave reid’s picture

Status: Active » Closed (won't fix)

FYI 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.