Comments (5)
This would be needed to use the official jQuery template plugin in Liquid templates: http://api.jquery.com/category/plugins/templates
That plugin uses double curly braces for all its tags, except for the alias ${ output } which is a short version for:
{{= output }}
Adding a “raw” tag may also solve the problem we currently have with Assistly. Assistly lets us use Liquid in replies to customers. That means that design supporters cannot share code snippets in a reply. Anything that uses double curly braces is 'parsed'. We have to create a gist every time we want to share a code snippet with our customers. We cannot use square brackets and ask them to make the substitution. Well, we can, but... that's so painful: “In the above code snippet you must change [[ to double { and ]] to double }.”
from liquid.
Just to be clear, the only place you can place a jQuery template is inside a .liquid template, hence the road block. A jQuery template looks like this:
<script id="my-template" type="text/x-jquery-tmpl">
<li>
<a href="${url}">
<span class="title">${title}</span>
</a>
</li>
</script>
It's a script tag, so it cannot be placed in a .js file.
As soon as you want to use logic in such template, you have to use the double curly braces notation: http://api.jquery.com/category/plugins/templates
I was thinking about modifying the plugin itself but it's hosted on a CDN and it is updated and improved constantly.
from liquid.
I'd love to see this feature. It would also help with mustache and other template languages beside jQuery.tmpl().
Because - according to "Liquid for Programmers" - Liquid parses all block tags, we'd have to patch liquid itself. A custom block tag itself can't help here.
from liquid.
Wrote a proof of concept which i'm using for my jekyll generated site: https://gist.github.com/1020852 . Should be trivial to include it in other projects.
from liquid.
Well, it seems like there is a little issue in this implementation: If you use {{ variable }} inside a html attribute it gets masked. For example:
<a href="#{{id}}">{{name}}</a>
becomes
<a href="#%7B%7Bid%7D%7D">Test</a>
I'll have a look into this during the next days.
from liquid.
Related Issues (20)
- video_tag fully disable poster HOT 2
- Expose Liquid::Condition in public API
- alt attribute not set for media.preview_image with image_tag filter HOT 1
- Running rake example throws error
- Liquid rendering is unexpectedly changing the "context" attribute on non-Drop classes
- Liquid shopify skórki
- Add WISMOlabs to "Who uses Liquid?" wiki section
- App Block Missing Data On Theme Previews When Proceeded by a Hidden Section Containing an @app Block
- Sort orders by 'created_at' in paginate?
- Regarding deprecation of the total_discount
- Add limit to split filter, like split method in Ruby
- Liquid - Product Description Null Check Not Working
- Should strip_newlines also 'strip' LSEP ?
- Case statement evaluation renders multiple when conditions if a value is repeated
- String to Object? HOT 1
- ع
- Can't get key/value from hash HOT 5
- Allow overriding blank? method in drops HOT 1
- image_tag filter, incorrect width and height attribute values for SVG
- Liquid::Environment on isolated subcontexts
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from liquid.