I have decided to abandon the Contemplate module for D7 and use DS. I had code that worked in the template, but I cannot get it to work in a custom code field.

function contact_settings($field, $title = NULL) {
  if ($field['field_allow_phone']=='Display Phone Number') {
    echo "[node:field_phone_num]";
  }
  elseif ($field['field_allow_phone']=='Do Not Display Phone Number') {
    echo "Unavailable";
  }

I can output the tokens just fine separately, but I don't understand how I can use them in a statement so it runs properly. I'm sure it;s simple, and any help would be appreciated.

Comments

aspilicious’s picture

Status: Active » Postponed (maintainer needs more info)
aspilicious’s picture

More then 4 weeks without response, closing this issue for now. Please reopen if you still need help. I also advise you to ask these questions on drupal.stackexchange.com. Support questions tend to get answered faster in there.

aspilicious’s picture

Status: Postponed (maintainer needs more info) » Closed (works as designed)