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

cousett’s picture

I am looking to do this as well any help would be great.

ionmedia’s picture

+1

kbk’s picture

Status: Active » Fixed

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

CCK does not support this. You need custom code, and then, you do not need tokens because you can set the default value in the code itself, without tokens, just getting the data from wherever it is.

BTW, Token integration in CCK exist to provide tokens from CCK fields to other applications.

I can see a case for changing this to a feature request or documentation issue but will leave that to someone else.

kbk’s picture

Also, 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.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

DC_Marc’s picture

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