I’ve webform element labels like this:
Did [your pet] have any sicknesses?
and I wish to exchange [your pet] with a variable token?
Do I want to write down a customized module or can I do that by modifying one among Drupal Developer theme .tpl information?
Tried this code as steered:
<?php /* * Implementation of hook_form_alter() */ drupal_set_message(t('Outwith Drupal Developer hook'), 'warning'); // show outwith Drupal Developer hook perform wit_bootstrap_form_alter(&$type, &$form_state, $form_id) { drupal_set_message(t('Inside Drupal Developer hook'), 'warning'); // show inside Drupal Developer hook // goal my type / my discipline if ($form_id == "webform_client_form_1") { // goal my type / my discipline if ($type['neutered']['#title']) { $title = $type['neutered']['#title']; $token_val = 'freelo';//get_tokenised_value(); // Which ever approach you deal with that... $title = str_replace('[your pet]', $token_val, $title); $type['neutered']['#title'] = $title; } } }
Sponsored by SupremePR