It would be great, if a module could choose how the token module should format the field values.
E.g. allow
* no formatting
* plain text (->check_plain)
* html (use cck formatters?)
I'm using the module for the auto_nodetitle module - which is great. However the module would need unformatted tokens (no check_plain!), read more at: http://drupal.org/node/117812
| Comment | File | Size | Author |
|---|---|---|---|
| #3 | token_cck_text_raw.patch | 944 bytes | fago |
Comments
Comment #1
eaton commentedI've just changed the way that CCK data is translated into tokens, and I believe that it should solve some of the problems. If you can, please check out the current dev snapshot and see if it meets your needs?
Comment #2
eaton commentedFixed in version 1.5.
Comment #3
fagothanks!
It doesn't really meet my needs. First of all the raw option for text fields was missing. Attached is patch that adds the raw text option for cck text fields (and fixes the description which stated: "nodereference instead of text").
However, what I would really need would be a way to manually filter out only the raw formatting options.
The problem I have is that I need the the raw text, which mustn't be check_plained() before, because the text will be check_plained() after all (and invoking check_plain() twice breaks htmlspecialchars).
So it would be nice if one could restrict the available tokens to only the raw variants of all text fields, while for dates, numbers and so on all variants should stay.
This would be really useful for everyone who wants to pass the resulting string through check_plain().
Comment #4
eaton commentedNow included. Thanks! There's a [raw] tag and a [formatted] tag, to match the way other CCK fields are treated.
Comment #5
fagothanks, works fine.
Comment #6
(not verified) commented