Questions tagged [client-side-templating]
101 questions
5
votes
2 answers
Nunjucks: Loop through first 5 items in for loop
New to Nunjucks and have a similar problem to here but I couldn't get my code to work. I'm trying to loop through the first 5 items in a Nunjucks loop of 14 items. So far I've found that the range function should be able to accomplish this but can't…

Yawner
- 93
- 2
- 10
5
votes
2 answers
Kendo UI MVVM - How to iterate over and render a collection within a view?
I'm simply trying to loop over an array within my Kendo.View and attempting to render a property from the element. This would be super simple in MVC Razor, e.g.
@foreach( var displayLink in Model ) {
displayLink.Text
} Rather than…
Andrew Lundgren
- 1,134
- 1
- 12
- 18
4
votes
3 answers
Mustache-like templating language with extends?
I like the minimal-ness of mustache-style templating languages - I'm currently using mustache and icanhasmustache, but I've also checked out handlebars and hogan.
However I have a need to for an 'extends' type functionality, to allow a child to…

mikemaccana
- 110,530
- 99
- 389
- 494
4
votes
2 answers
Implementing a cycle tag in Handlebars.js
In Django there is a template tag called cycle: https://docs.djangoproject.com/en/2.2/ref/templates/builtins/#cycle
An example:
{% for o in some_list %}
...
{% endfor %}
Output:

hekevintran
- 22,822
- 32
- 111
- 180
4
votes
2 answers
Illustrator/SVG to JavaScript workflow? (A templating library?)
When "Saving as SVG" in Illustrator, this is the typical result:

dani
- 4,880
- 8
- 55
- 95
4
votes
5 answers
How to conditionally close html tag in Angular 2
In php there is possibility to conditionally close html tag.
Can we emulate something like that in angular 2?
For example
Some lorem "}; ?>

Marko Djordjevic
- 41
- 1
- 3
4
votes
1 answer
Handlebars - get unaltered content of block
I'd like to get the un-altered/un-rendered/whatever content of a block in handlebars. So, let's say I've got the following:
{{#template}}
{{name}} {{price}}
{{/template}}
If I've got a helper called 'template', I'd…

Stephen
- 5,362
- 1
- 22
- 33
4
votes
2 answers
pre-compiling javascript templates
After reading What are the differences between Mustache.js and Handlebars.js? I was puzzled with a question:
What does pre-compiling of javascript templates means?
Previously I was using a simple client-side caching, which was working something like…

Salvador Dali
- 214,103
- 147
- 703
- 753
3
votes
4 answers
Handlebars example not working
In my .hbs delivered by my node server:
but if i put the template in an external resource, i can't find…

Dustin Getz
- 21,282
- 15
- 82
- 131
3
votes
1 answer
How to save username and password in client side templating application
I am writing a web application using client side templating. This application needs to interact with a REST Server which supports Basic Http authentication (using ssl). So, with every request that needs to be authorized, username and password are…

db42
- 4,474
- 4
- 32
- 36
3
votes
0 answers
Rendering HTML (and CSS) offscreen for advanced templates
I'm building a Javascript-based client side templating engine for an internal app. It loads HTML/CSS-based templates from the server and combines them with HTML-based contant (P, EM, etc.)
The templates basically have fixed size areas (defined via…

Michael
- 1,742
- 3
- 18
- 24