I wonder if there is any documentation available to learn how to use this

Thanks :-)

CommentFileSizeAuthor
#5 README.txt1.07 KBgreggles
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

ardee-1’s picture

I second the request!

johnvsc’s picture

I third it .... keep it alive until have some direction :)

johnvsc’s picture

How to use this becomes self evident when you use it:

Follow the directions to enable the module.
When you create a new field in a Content Type, you will see an option to "Tokenize" the field. There are three choices: 1) is to disable it (you choose this, probably, to disable a tokenized field that you have enabled before.... which, logically, means that it should be the last choice....) 2) is to Replace on node views / Preserve tokens ... which means to "save" the value that exists already. and 3) Replace on node submission (which should be first, in the ui), which you would select when you are initially creating a Content Type Field.

Then you are done setting it up.

Now, when you go to create some content, you will see all of the tokens exposed for you to use in the field.

Like me, you probably thought that it would allow you to put in some content (like global $user;) when you created the for field....

Well, you can (morbus helped me with this>) in the "default" field. Say you want to return something from a global (like user ... or node) you would put this in the "default PHP code "section

global $user; 
return array(array('value'=>$user->mail));

That would return the users email in the field block...

I am not sure how you would get any other fields in there... maybe using the global $node.

For php newbies, you need to put global $objectOrArrayName to bring it into scope.

Cheers

SocialNicheGuru’s picture

I am still a little unclear.

I defined a CCK Link called it view_my_profile.

I want this to be a default value that the user cannot touch, view, or modify.

I thought that I could use tokens and enter user/[author-id] into the default field so that if I clicked on "view_my_profile" I would be taken to user/88 in other places on the site (if 88 was the author of the user for example).

But that does not happen.

I get the actual text for "view_my_profile" in my view "user/[author-id]" without any token replacement. I thought I would get user/88 if "88" was the user's uid. If set "view_my_profile" as "default to link with title", I get nothing.

if I set it to "plain, as text URL", I get the text "user/[author-id]"

Thanks,
Chris

greggles’s picture

Title: Any Intructions at all ??? » Provide README.txt for Tokenize
Status: Active » Needs review
FileSize
1.07 KB

@activelyOUT - the symptom you describe sounds like #273294: fields must be edited twice before tokenizer works

@all - I've attached a possible README.txt file. Please let me know any advice on making it better.

Thanks!

greggles’s picture

Category: support » task
Status: Needs review » Fixed

I've committed that file for now.

Thanks johnsvc for your help with this.

I marked this fixed, but If anyone has more ideas on how to make it better please let me know.

greggles’s picture

Assigned: Unassigned » greggles
Anonymous’s picture

Status: Fixed » Closed (fixed)

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