Closed (outdated)
Project:
Token Filter
Version:
6.x-1.0
Component:
Code
Priority:
Minor
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
2 Mar 2010 at 10:35 UTC
Updated:
24 Mar 2018 at 06:04 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
markwittens commentedMaybe convenient for other users to provide a small manual:
Usage:
[token node [[cck-field-name]] ]
Example:
To put the contents of the field "field_customfield" in the text you can use the following token: [token node field_customfield-raw]
Comment #2
pvhee commentedThanks for the patch.
I saw the code uses the global variable '$_customfilter_code_vars;'. From what I could find, it is a variable of the module Custom Filter (issue http://drupal.org/node/259819 as you mentioned in the patch). Does this mean you require dependency of this module? Can you explain a bit more about how your patch is supposed to work in absence of that module?
Comment #3
markwittens commentedThere's no dependency on the Custom filter module, the only link is the name of the variable and that actually should be renamed to something else to prevent this kind of confusion in the future. My bad, I should have reviewed my code after copy-pasting :-)
Comment #4
WhenInRome commentedThanks!
Comment #5
mpisano commentedThanks its works great!!!
Comment #6
newToo commentedI'm trying to create a cck text field that allows me to use tokens to insert the node's url... would this module be used for that? I don't seem to have any options to add tokens to the text field.
Comment #7
pvhee commented@markwittens: Could you roll out a new patch of #0 with suggestions from #3?
Comment #8
markwittens commentedHere's the patch with the suggestion from #3 in it.
Comment #9
Hobbes-2 commentedHum, could you tell me when this patch will be in the dev version ???
thanks!
Comment #10
ckwon commentedhello,
thanks for this nice patch. i searched this function for hours ;).
There is only a little problem. Replacement does not work if you preview a new node, only if you save it.
Comment #11
Grayside commented#10: That will be an ongoing problem with this module I expect. The problem is that Token Filter does not compute it's values from the node form, but rather by loading the current values from the database. Until you've saved the node, there are no current values.
Attached patch makes the code more clear about refusing NULL node objects, and makes sure the token syntax is left in place for preview.
Comment #12
imclean commentedI'm looking at embedding CCK fields too. What's the advantage of this method over Linodef? http://drupal.org/project/linodef
Comment #13
murzLinodef do the additional node_load, and in the key you must manually set the nid, but in this solution node loaded only once and cached in memory.
Comment #14
szantog commentedAttached patch in #11 works perfect.
Comment #15
drecute commentedpatch #11 does not work for me. It rather removes the
[token op]string from the token and falls back to the default i.eglobalanduserComment #16
jvieille commented#11 does not work.
In my case, nodeapi reports the OG group nid, not the node nid.
I don't use the hook function token_filter_nodeapi, I just changed this function:
Comment #17
darvanenDrupal 6 version is no longer supported. Please reopen this if you find it is relevant to Drupal 7 or 8.