Skip to main content
edited tags
Link
avpaderno
  • 97.9k
  • 15
  • 164
  • 284
Source Link
Mrweiner
  • 2k
  • 4
  • 26
  • 49

Correct way to alter markup as html within theme_preprocess_container?

On my node edit form I've got a field widget that needs some information added to it. Before my alterations, the kint dump of $variables['children'] looks like:

enter image description here

However, after manually setting $variables['children'], the dump looks like:

enter image description here

Before alteration, html renders correctly. However, afterward it is all just rendered as a string with the HTML displaying on the page.

enter image description here

I've tried using the create() method instead that's shown as available under:

enter image description here

...but it doesn't do anything at all.

I've also instead tried changing $variables['element']['display']['#markup'], but that doesn't have any visible effect.