I have a cck field that I need to pull the raw value and not the label.
Any idea how I would go about doing this?
| Comment | File | Size | Author |
|---|---|---|---|
| #7 | raw-token-mail-1086434-7.patch | 4.79 KB | peter törnstrand |
I have a cck field that I need to pull the raw value and not the label.
Any idea how I would go about doing this?
| Comment | File | Size | Author |
|---|---|---|---|
| #7 | raw-token-mail-1086434-7.patch | 4.79 KB | peter törnstrand |
Comments
Comment #1
itangalo commentedThat would require a change in this module. It wouldn't be that difficult to do, per se, but it would start bloating the available tokens in a way that I don't really want to do. Instead I would like a way to set raw/formatted value for each merge style that you define.
This is related to #974374: provide lists of Term-IDs.
If you like the idea, this will be the main issue for discussing and executing this idea.
Comment #2
jday commentedI need to get an array of a multiple value email field to print out like this:
email1@gmail.com, email2@gmail.com, email3@gmail.com
currently the token for [node:field_email-default-array-view] prints out like this:
; a href= "mailto:email1@gmail.com"; a href= "mailto:email2@gmail.com"
maybe this is an issue for the cck email module and its display values...? ideas anyone?
Comment #3
jday commentedI found a patch for plain text email display here:
http://drupal.org/node/754554
but the only token array options are still the formatted "a href=emailvalue...." array
Comment #4
itangalo commentedHi
Sorry for responding so late – it seems to me that you actually can do this with the current functionality in Array Tokens. Try configuring your token with no prefix/suffix, and "; " as infix. Then you should be able to get all e-mail addresses like so:
Correct me if I'm wrong – closing this issue for now.
Comment #5
jday commentedI need all html tags stripped because the array of emails would go into a Rules email "to" field. I ended up switching to multiple single fields rather than a multiple value field. I could not find where the emails were getting formatted like that.
Comment #6
itangalo commentedAh, now I see. Thanks for clarifying.
The only fields available in "raw" format right now are text fields, reference fields and text fields (I think), plus tags – the ones in core + CCK. Doing this for e-mail fields wouldn't be *that* difficult, but it will be kind of difficult to find the time to actually do it. :-(
I'm gonna mark this as a feature request and change the title, to make it easier for me to remember the issue.
The order I take care of feature requests will be determined by the discussions at each issue, plus my unpredicable mood for the day. Eh. Patches of course welcome.
Thanks for the idea for a new useful feature.
Comment #7
peter törnstrand commentedI have a similar use case where I wan't to send e-mails to multiple users based on a multiple user reference field. I created a quick patch as proof of concept.
Please note that this patch was made very quickly and I'm sure there are lots of room for improvements. It does however work.
Comment #8
itangalo commentedThanks for the patch! Will have a look at it later.
Comment #9
jgoodwill01 commented+1 I can't seem to get this to work. CCK Email fields are now available in -raw format. How can I get a raw array? I need this for a Rule as well.
Comment #10
jgoodwill01 commentedActually I was able to fix this by changing the Display Token settings to Plain Text.