http://drupal.org/project/token_filter

Seems like this module and Token Filter could work together really well - say if you wanted to embed product attributes into the product body...

Comments

tr’s picture

Version: » 6.x-1.x-dev

Interesting idea. I didn't know about that module. But how do you picture it working? This module defines a token named the same as the product attribute, with a value equal to the selected option name. So a product with a "Color" attribute currently gets a [Color] token, which is set to (for instance) "Red", "Green", or "Blue" when a customer puts the product in the cart. The attribute token has a value because the customer has selected one of the attribute choices when making a purchase. On the product view page, however, there are no choices selected, so the token would contain the default option name (if one is defined) or nothing at all.

I guess I could define some new tokens, like [Color:default] or [Color:values] which could be used in this situation. Unfortunately, tokens are strings, not arrays, so for example [Color:values] would have to return something like "Red, Green, Blue" and not an array of all available colors. Is that the sort of thing you had in mind?

nicholasthompson’s picture

Yeah that kinda thing like "available colours" then all you do is tweak the attributes rather than having to rewrite all instances of available colour in the copy...

It's a good point about attributes often being there to provide options, rather than "meta data" of the product...