Closed (outdated)
Project:
Token
Version:
6.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
20 Feb 2008 at 23:01 UTC
Updated:
24 Apr 2024 at 18:55 UTC
Jump to comment: Most recent
Comments
Comment #1
doublejosh commentedI should be made clear that this is a multiple values taxonomy term.
Comment #2
nicholasthompsonThis is actually not an issue with Page Title, its more of an issue with Token. When you do a token_replace in the node 'scope' it will invoke the node_token_values function in this file...
http://cvs.drupal.org/viewvc.py/drupal/contributions/modules/token/token...
Note how it only works out the term information for the token for ONE term (it does a
break;at the end of oneforeachloop).So, to solve this you really need to speak to Jeff Eaton and either submit a patch to Token OR pay Jeff to fix it ;-)
Also, you're idea of "[term:1]" works fine if you KNOW that all nodes will have a a term at that index... I think maybe an addition of a token [all-terms] might be better?
Alternatively, you could write your own module which implements the Token API in the same way that Page Title does (I believe its the last two functions in the module, off the top of my head).
Comment #3
summit commentedHi Josh,
Also interested in this functionality!
greetings,
Martijn
Comment #4
summit commentedCouldn't the solution be to have the first term (in hierarchy; using the needed term-depth) from a specific vocabulary, is that doable?
greetings,
Martijn
Comment #5
nicholasthompsonI think this really falls into a feature request for Token. Could Token either implement the [term-raw:1] type token where the integer represents the term offset on the node (as suggested in comment #2)... Or maybe the number represents a filter on the vocab (could make more sense).... Or maybe depth (as suggested in comment #4)?!
Alternatively maybe it could be a contrib module that implements the Token API?
Comment #6
gregglesCorrect - this is largely a duplicate of #185446: Provide tokens for each vocabulary (not entirely, though, so I'll leave this postponed).
It could also be done in a contrib if someone wanted to, but note the performance concerns.
Comment #7
mmilo commentedWill this fix (yes, I realize it's currently postponed) include multiple values for CCK fields? Or am I missing something?
For example I have a Node Reference CCK field that allows for multiple values, and the Token module will only give the [raw] values for the first value.
I didn't create a new issue as this one seemed close enough to my question.
Thanks.
Comment #8
terry22 commented@mmilo:
Did you fix the issue of Node Reference with multiples values and the corresponding token?
Comment #9
mmilo commentedI'm afraid not.
I needed this functionality in conjunction with using the Rules module. What I ended up doing was writing some custom PHP code that would use node_load and iterate through the CCK field.
There might be a more elegant solution now (this issue is pretty old).
Good luck!
Comment #10
itangalo commentedI'm feeling a bit stupid finding a lot of issues about Token and multiple value CCK fields and multiple taxonomy terms. I took as an exercise to code this myself, and ended up with something that looks pretty decent.
Code and demo screencast can be found here, if anyone's interested: http://nodeone.se/blogg/learning-to-code-array-tokens-module
Comment #11
bluegeek9 commented