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

CommentFileSizeAuthor
#3 token_cck_text_raw.patch944 bytesfago

Comments

eaton’s picture

Status: Active » Needs review

I'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?

eaton’s picture

Version: 5.x-1.4 » 5.x-1.5
Status: Needs review » Fixed

Fixed in version 1.5.

fago’s picture

Title: token formatting (check_plain) » preselect token formatting (check_plain)
Status: Fixed » Needs review
StatusFileSize
new944 bytes

thanks!

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().

eaton’s picture

Status: Needs review » Fixed

Now included. Thanks! There's a [raw] tag and a [formatted] tag, to match the way other CCK fields are treated.

fago’s picture

thanks, works fine.

Anonymous’s picture

Status: Fixed » Closed (fixed)