Token replacement from specific vocabularies?

We encourage users to post events happening in the community to the community events group on https://www.drupal.org.
laken's picture

I've got a content type with a Name field, and 2 taxonomy vocabularies applied, one for "person type" and one for "issue type". I'm using auto node titles module, and I want to to format the titles like this

[name], [person type], on [issue type]

e.g.

Andy Laken, Volunteer, on Governance

But in the replacement pattern list, I find only [term] which is the "Name of top taxonomy term" (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?

Many thanks for any help...

Comments

..

greggles's picture

The "top" taxonomy term is the lowest weighted one. I'd love to have a better description for that because it seems to confuse people. Can you propose one?

For tokens for specific vocabularies please see http://drupal.org/node/185446

--
Open Prediction Markets | Drupal Dashboard

Maybe talk about it in terms

flickerfly's picture

Maybe talk about it in terms of heavy and light?

"The heaviest item gets pulled to the bottom of the pile. The lightest floats to the top."

When I'm trying to remember, that's how I think about them.

Thanks Greg. I read the

laken's picture

Thanks Greg. I read the thread you linked to, and followed the link "Eaton has discussed how this is currently possible" but didn't find any description of how to do it. I have some coding capability and would love to implement this if there is a fix/workaround - just couldn't find it in the thread you referenced. Any help?

cck hooks

greggles's picture

@alaken: there's only one comment that eaton makes, so it's in there :) I guess it's not entirely clear though.

Basically, take a look at the token_cck.inc and how it works. Every time the hook_token_list is called it regenerates the list of possible tokens. Similarly the hook_token_values dynamically determines all of the possible tokens that could be used each time it is called. Does that help?

@flickerfly - can you propose a specific bit of text to replace the current definitions?

--
Open Prediction Markets | Drupal Dashboard

@greggles Thanks for the

laken's picture

@greggles Thanks for the clarification. I will look at that code and see if I can understand it. I'd love to offer some help to the effort if my skills are up to it.

For "Name of top taxonomy

flickerfly's picture

For "Name of top taxonomy term", maybe "Name of lightest weight taxonomy term".

I know it is a bit long. If the context permits, pulling the word weight out would improve it, but they'd have to know what light is referring to. I'm not sure the context of the phrase would permit it.

Tokens

Group organizers

Group notifications

This group offers an RSS feed. Or subscribe to these personalized, sitewide feeds: