# ln.templates Templating engine primarly used for html. ### Features: ##### Iterations Render the children 5 times, with the variable xy set to the 5 values 0, 3, 6, 4, 1 : ... ##### Conditionals Render tag only if attribute v-if evaluates to a non false value. ... ##### Inclusions Replace this tag with the rendered content of othertemplate.html: ##### Slots Use named slots to send content to included template:
Define Slots to be replaced with content from "caller":
Some stuff...
I am the default content, that will be rendered, if there is no slot named "slotname" I am the default slot I am also the default slot By not providing any v-slot elements v-include will use the element itself to be the default slot. This tag will be surrounded by the frame! Because there is no slot defined within it. ##### Javascript Define / run JavaScript logic within the script: let v = 1 + 2; Add style classes conditionally via expression:
Set attributes values from expressions:
Include content by expressions within text elements:
This is my favourite color: {{ myFavouriteColor }}. ### Filesystem overlay Overlaying is possible by using RecursiveResolver class as ITemplateResolver. Example directory layout: /layout/frame.html /layout/htmlhead.html /tmpl_a.html The files use the following references: tmpl_a.html -> /layout/frame.html -> /layout/htmlhead.html htmlhead.html may contain something like ... ... We can now add a file to new folder: /layout/frame.html /layout/htmlhead.html /tmpl_a.html /layouts/b/layout/htmlhead.html By a call to RecursiveResolver.FindResolver("/layouts/b") we get a ITemplateResolver that looks up Folders and Templates in that directory first, then in the parent folders back to the root folder of this structure. So if we call GetTemplateByPath("tmpl_a.html") we get the same Template but this instance will use the reference chain tmpl_a.html -> /layout/frame.html -> /layouts/b/htmlhead.html which effectivly overlays *htmlhead.html* with an alternative version and still uses the */layout/frame.html* template.