Quantcast
Channel: Recent posts across whole site
Viewing all articles
Browse latest Browse all 49241

Adding strings in CCK Computed field

$
0
0

Hi Guys,

I have recently joined NZ Drupal Group. I am a Junior Developer and am bit stuck on something. I am hoping somebody can help me out here.

I have a field called:
field_a | Type: text
field_b | Type:computed

so in my computed field I would like to do:

if ($node->field_a[0]['value']){
$var1="some text";
$var2="some more text";

$node_field[0]['value']="$var1.$node->field_a[0]['value'].$var2";

This doesn't display anything. I tried creating temporary arrays as well to achive the same thing but that doesn't work either. I am just wondering if this is the correct way to go about doing this or is there any other better method.

Please do advise and thank you for your time. Cheers.


Viewing all articles
Browse latest Browse all 49241

Latest Images

Trending Articles



Latest Images