Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
For a field, I'm trying to create a default value that contains token replacements. When I go to view the page that was created, it displays what I typed in literally instead of displaying the replacement value.
What I would like to do is to be able to use token replacements with CCK just as I do with Pathauto. [Term], [Vocab] etc.
Comments
Comment #1
cousett CreditAttribution: cousett commentedI am looking to do this as well any help would be great.
Comment #2
ionmedia CreditAttribution: ionmedia commented+1
Comment #3
kbk CreditAttribution: kbk commentedI was looking for an answer to this as well and I'm fairly certain the answer is here #639858: Where to look for information on token support in CCK?. To quote markus_petrux:
I can see a case for changing this to a feature request or documentation issue but will leave that to someone else.
Comment #4
kbk CreditAttribution: kbk commentedAlso, I found yched's comment here to be a helpful baby step in setting default values via php code. If the link makes you wonder what information is actually within $user you can find that here.
Comment #6
DC_Marc CreditAttribution: DC_Marc commentedI have this exact same need as well. Specifically, I am trying to set the default of a select list (called State) to be equal to an address field's province token [field_address-province_name]. I am doing this because Address doesn't seem to enable Views filtering by province as a dropdown by default, so I was trying to circumvent that inability of Address to meet my needs. Still, would be useful more generally as well!