Confused - how do I send a field value via sendtophone?

HunterElliott - October 31, 2009 - 22:36
Project:SMS Framework
Version:6.x-1.x-dev
Component:Send to Phone
Category:support request
Priority:normal
Assigned:Unassigned
Status:active
Description

I may just be dense at the moment, but I'm not figuring out how to do this... I can get the "send to phone" link for a node's content w/no problem. However, I don't want to send the URL for this node. Instead, I want to send the value of either the Body of the node or, preferably, the value of a particular field. How do I do this?

#1

haleagar - November 3, 2009 - 04:47

No idea yet, I just started using the framework tonight, but I'm trying to do the same thing.
Lets see who finds out first ;)

#2

HunterElliott - November 4, 2009 - 16:54

:) ultimately, I want to send either specific text from a node (thinking a specific text field value), OR possibly preferred would be to send a specific image when the "send to phone" link is clicked on (also thinking it would just be a field value it would grab to send the data). Unfortunately, I've no idea where to start looking on this.

#3

haleagar - November 4, 2009 - 19:27

I agree I would want a specific CCK field to be included in the SMS.
Though Title might be a logical addition, I don't need it as I'll have a specific field.

Now there is a "Inline SMS" filter, that claims that if I enabled it on a field it will grab text between [sms][/sms]
and add it to the send to phone box.
However all it does is hide the text from displaying in the node view, without putting it into the send to phone.
(though I didn't try it on body yet)

there is also a CCK widget called "text field and SMS send to phone" which might be exactly what I want, however it just hides the CCK field from showing in the input form entirely.

I can't yet follow what is supposed to happen to get those values into the send to phone form.
if I look at sms_sendtophone_form I certainly don't see it happening, though if you're up for it that seems the logical place to start adding text into the form.

anyway maybe the above functionality is still in dev, or broken in the update to drupal 6?

#4

haleagar - November 4, 2009 - 19:58

In particular the quick hack would be

in the file sms_sendtophone.module
line 361 is:

'#default_value' => url('node/'. $node->nid, array('absolute' => TRUE)),

if your content type had a CCK field named field_sms then this ought to do the trick.

'#default_value' => $node->field_sms[0]['value'] . ' ' . url('node/'. $node->nid, array('absolute' => TRUE)),

or if you don't want the link

'#default_value' => $node->field_sms[0]['value'],

however solving how it is intended to work would be a MUCH better option for all involved.
if anyone could help me out by telling me what is supposed to happen with that CCK widget I'll see what I can do.

sorry edited that to remove check_plain($node->field_sms[0]['value']), check_plain will upgrade the text to html I wanted the opposite.

 
 

Drupal is a registered trademark of Dries Buytaert.