5 Replies Latest reply on Dec 5, 2018 10:39 AM by Sanford Whiteman

    Rendering Marketo Embedded code in controller.php

    Ritvi Sarangi

      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