DrupalGap icon indicating copy to clipboard operation
DrupalGap copied to clipboard

How to use Drupal tokens in DG?

Open luxio opened this issue 8 years ago • 1 comments

I there a way to user Drupal tokens (e.g. '[current-user:name]') as default values for fields in DrupalGap?

luxio avatar Feb 21 '17 15:02 luxio

@luxio I've only toyed with token inside the DrupalGap Webform module (on the SDK side). Even then, those aren't true tokens in a Drupal sense, they are just custom webform tokens that get prepopulated into webform components.

I would just use a hook_form_alter() in DrupalGap to set the value on whatever elements/fields necessary with Drupal.user.name if they are logged in if (Drupal.user.uid) { /* they are logged in */ }.

signalpoint avatar Feb 28 '17 15:02 signalpoint