Twig icon indicating copy to clipboard operation
Twig copied to clipboard

css not applying in form generated with render controller

Open padrecedano opened this issue 2 years ago • 0 comments

I am adding a form inside HTML content with render controller (Twig), but the .css styles are not being recognized for that specific content, for the rest of the content there is no problem.

The HTML is into one file called footer.html with this content:

{% apply inline_css %}
    <footer id="footer"> 
      <div class="footer-newsletter"> 
        <div class="container"> 
          <div class="row"> 
            <div class="col-lg-6"> 
              <h4>Our Newsletter</h4> <p>Tamen quem nulla quae legam multos aute sint culpa legam noster magna</p>
            </div> 
            <div class="col-lg-6">  {{ render(controller(
                'App\\Controller\\SubscribeController::new'
            )) }}    
            </div>
            ... etc
{% endapply %}

And I am adding this file in a Twig template with include:

...

{% include 'footer.html' %}

...

When I test the page in the browser, it generates the form well, but the styles for the content that is created using {{ render(controller( 'App\\Controller\\SubscribeController::new' )) }} are not applied.

If I copy/paste the generated HTML and .css in one editor the styles do apply. I would like to know why they do not apply when testing the page directly and what should I do to make them apply. You can see the result of snippet in this question.

padrecedano avatar Jun 07 '23 03:06 padrecedano