-
Notifications
You must be signed in to change notification settings - Fork 339
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
nest multiple templates inside one template #151
Comments
I think there seems to have a way around, using {{for /}} even for a single loop. that way just import the template in to the other template, I don't know if it's the right way to do this, but I'll close the issue, since I've managed to get my problem solved. |
You can write:
or or or You can also write |
The above comment gives some alternatives for template composition. Does that cover your requirements? BTW to include markup in a comment on GitHub, you can wrap with 'backtick' characters, as in
See GitHub Flavored Markdown link above, when in edit mode. |
Say I have three templates:
<script id="entry" type="text/jsrender"></script>
<script id="head" type="text/jsrender"></script>
<script id="tail" type="text/jsrender"></script>
The layout is like
<entry>
<head/>
<tail/>
</entry>
I have arrays of entries, I have no way to embed head and tail template inside entry template, so that, jsrender will treat entry as a single template, and will works for [entries].
the {{for /}} can only bind a collection to one template. If the template is formed up with small templates, is there a way to compose all the small templates into a single template?
The text was updated successfully, but these errors were encountered: