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
Comment #1
aspilicious commentedyou should look at token_replace: https://api.drupal.org/api/drupal/includes%21token.inc/function/token_re...
Comment #2
aspilicious commentedMore 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.
Comment #3
aspilicious commented