Need Help Understanding Proper Twig Template Useage

chubbard216chubbard216 Member
in Help edited December 2013
Well, I am quite certain I have thoroughly figured out how to not properly use the twig templates - maybe someone can help point me in the right direction:

I created a new page (checkout.php) and uploaded it to the server. The page contained the header, footer and an open container for the body.

Where I would normally insert the ^^cart^^ placeholder, I inserted the code downloaded from the page.

After uploading the file to the server, I went back to the Foxycart Admin and navigated to the Cart section, entered the URL to my checkout.php page and cached it.

The result was anytime I called the cart via my links/forms, a blank colorbox loaded.

Thanks in advanced

  • fc_adamfc_adam FoxyCart Team

    Could you link us to the checkout template you created and tried to cache? Feel free to whisper if it's private.
  • fc_adamfc_adam FoxyCart Team

    Sorry for the delay in getting back to you - I was away for a few days, but back on board now.

    It took me a little while to track this one down - but it relates to a small bug between our Twig templating language and the Modernizer javascript include. In it's minified code it has a CSS block that is being interpreted as an opening twig comment (specifically "{#") - and without any closing comment it's breaking everything. On a standard template, that would error as having an unclosed twig comment - but as you're using the Twig templates which has some other comments, it's just going really wacky.

    If you edit your Modernizer.js snippet to put a space between those two characters "{#" - that would fix this issue. Alternatively, you could also edit your template to wrap that include in raw tags, so it would look like this:
    {% raw %}
    <script src="your/include/of/modernizer.js" />
    {% endraw %}

    That would also fix this issue.
Sign In or Register to comment.