AnsweredAssumed Answered

Rendering Marketo Embedded code in controller.php

Question asked by Ritvi Sarangi on Dec 4, 2018
Latest reply on Dec 5, 2018 by Sanford Whiteman

hi all,

 

I am trying to implement a form in our drupal 8 website. The trick is all the pages on our website, is a module itsself.

Previously we had hubspot which was rendered as :

`return [

      '#type' => 'container',

      '#attributes' => [

        'class' => [

          'contact-forms',

        ],

      ],

      'title' => [

        '#type' => 'markup',

        '#markup' => '<h2>XYZ</h2>',

      ],

      'hubspot-contact-form' => [

        '#type' => 'markup',

        '#markup' => \Drupal::service('renderer')->render($form),

      ],

      '#attached' => [

        'library' => [

          'phenom_hubspot/hubspot-form',

        ],

      ],

    ];`

 

But now, on writing the embedded code in the #markup, yeilds only the code on the page. Please help. Have been stuck on the process for days now. Thanks

Outcomes