Last active
November 29, 2022 22:38
-
-
Save gheydon/3c94ca27966044cff9e4767a44c81b13 to your computer and use it in GitHub Desktop.
Change the configuration for the token browser for a webform element.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Implements hook_form_BASE_FORM_ID_alter(). | |
*/ | |
function example_form_webform_ui_element_form_alter(&$form, FormStateInterface $form_state, $form_id) { | |
if ($form["properties"]["type"]["#value"] == 'example_element') { | |
$form["token_tree_link"]["token_tree_link"]["#token_types"][] = 'node'; | |
$form["token_tree_link"]["token_tree_link"]["#recursion_limit"] = 4; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment