Both sides previous revisionPrevious revisionNext revision | Previous revisionLast revisionBoth sides next revision |
v:1.0:templates [2012/08/14 08:36] – [Using Twig with FoxyCart] foxybrett | v:1.0:templates [2016/05/30 18:36] – [A Quick Start Guide] roman |
---|
- Hit the "update template" button at the bottom of the page //after// the page has reloaded and you've received the green success box. If you'd like, you can copy the cached code and review/modify it (though if you have to modify it, it's probably a bug that we'd love to fix if you [[http://www.foxycart.com/bug-report-because-bugs-happen.html|let us know]]). | - Hit the "update template" button at the bottom of the page //after// the page has reloaded and you've received the green success box. If you'd like, you can copy the cached code and review/modify it (though if you have to modify it, it's probably a bug that we'd love to fix if you [[http://www.foxycart.com/bug-report-because-bugs-happen.html|let us know]]). |
- Test your template. Try something like this to go directly to checkout: ''http://YOURDOMAIN.foxycart.com/cart?name=blah&price=10&cart=checkout'' | - Test your template. Try something like this to go directly to checkout: ''http://YOURDOMAIN.foxycart.com/cart?name=blah&price=10&cart=checkout'' |
| - Keep the template and its associated files (images and CSS) on the server at the specified URLs. |
| |
==== Advanced Customizations for Advanced Fun ==== | ==== Advanced Customizations for Advanced Fun ==== |
=== Allowed Twig Tags and Functionality === | === Allowed Twig Tags and Functionality === |
At present, the only allowed functionality for Twig is as follows: | At present, the only allowed functionality for Twig is as follows: |
* Tags: ''if'', ''for'', ''include'', ''macro'', ''block'' | * Tags: ''if'', ''for'', ''include'', ''macro'', ''block'', ''set'' |
* Filters: ''escape'', ''raw'', ''length'' | * Filters: ''escape'', ''raw'', ''length'' |
===== Default Template Styles ===== | ===== Default Template Styles ===== |
| |
==== Important Notes ==== | ==== Important Notes ==== |
| * **Linked Stylesheets if the ''rel'' attribute is after the ''href'' attribute.** This one is weird, and //shouldn't// be a problem (the regex is perfect), but if you have ''<link>'' elements that aren't being cached, switch the order of the attributes and put the ''rel="stylesheet"'' before the ''href'' attribute. |
* **Preventing Hotlinking?** If you're running scripts to prevent hotlinking, that may interfere with the template caching. If images aren't showing up properly, turn off your hotlinking protection while you cache your templates. | * **Preventing Hotlinking?** If you're running scripts to prevent hotlinking, that may interfere with the template caching. If images aren't showing up properly, turn off your hotlinking protection while you cache your templates. |
* **Attributes must be enclosed in single or double quotes** like ''src="foo/bar"'' or ''src='foo/bar'''. | * **Attributes must be enclosed in single or double quotes** like ''src="foo/bar"'' or ''src='foo/bar'''. |