Forums
Hi Team, I am using Opigno 2 Drupal 8. While trying to change the HTML for add a training form, I tried to create a suggestion as below:
function hook_theme_suggestions_form_alter(array &$suggestions, array $variables) { $suggestions[] = 'form__' . str_replace('-','_', $variables['element']['#id']);
}
Then, added the suggestion to theme:
function hook_theme($existing, $type, $theme, $path) {
return [ 'form__group-learning-path-add-form' => [ '#theme' => 'form--group-learning-path-add-form', 'render element' => 'form', ], ];
}
So now, I can see that the above twig is available in suggestion as well as is now being executing. The problem here is that the twig renders the children variable and that is a markup.
How can I avail the form object/array in twig ?