Error message when updating cart template

mwahahamwahaha Member
in Bugs & Feature Requests edited December 2012
I'm caching a template that I've used before, in 0.7.2. When I try to cache the exact same template page in 1.0, I get the error message: "Error: Your template was not saved because there was an error in your Twig template syntax: Unclosed comment at line 13"

This is weird because I'm not using Twig at all! This is the exact same file I was using before in 0.7.2 with no errors. It looks like your Twig syntax checker is hanging on something in my css but I can't tell for the life of me what it is. Line 13 is at the end of a big dump of minified CSS. I tried poking around and ripping out the css comments:
/* <![CDATA[ */
and
/* ]]> */

but that of course does nothing. I'll whisper the page, and maybe you can spot the hangup?
Tagged:
Comments
  • mwahahamwahaha Member
    edited December 2012
    Hmmmm.... when I try to whisper the link now, with a post that hasn't been replied to yet, when I click "post comment" I get a "You must select at least one recipient" error message, that doesn't tell me how to actually select that recipient... (maybe this is a design feature of the forum app...)
  • fc_adamfc_adam FoxyCart Team
    edited December 2012
    @mwahaha,

    Try wrapping your CSS in your template like this:
    {% raw %}
    <style></style>
    {% endraw %}
    

    While you're not using Twig in your template, 1.0 will render your template using Twig, so it gets validated by Twig. We're looking to add this 'raw' flag automatically when caching templates in the future, but for now that should get you working.
  • mwahahamwahaha Member
    edited December 2012
    Thanks Adam. Just for the record, for anyone stumbling across this, putting the raw tags outside the style tags triggers some extra dynamic logic. In my case it was putting uninterpreted FC tags in my cart. Adam's off-thread suggestion to switch it up and actually put the raw tags inside the <style> tags in the cached templates solved both problems:
    <style>
    {% raw %}
    div {color: #bada55}
    {% endraw %}
    </style>
    
  • fc_adamfc_adam FoxyCart Team
    @mwahaha,

    Thanks for following up mate! After replying to your email I thought it sounded familiar to a forum thread, so thanks for posting the correction.
Sign In or Register to comment.