Jerry Preissler
08/06/2023, 12:23 PMclass ContentTemplate(idList: List<DokumentId>): Template<HTML> {
val ids = idList
override fun HTML.apply() {
body {
ul {
ids.forEach { it ->
li {
a(UriRenderer.render(it).toString()) { +it.shortString() }
}
}
}
}
}
}
Cies
08/07/2023, 9:26 AMidList
to ids
. It seems ytou are making a sub-template, so the body
tag was unexpected. To make a subtemplate I'd not overwrite apply
in a class, but simply make it a function like:Cies
08/07/2023, 9:27 AM@HtmlTagMarker
fun FlowContent.contentTemplate(idList: List<DokumentId>) {
ul {
ids.forEach { it ->
li {
a(UriRenderer.render(it).toString()) { +it.shortString() }
}
}
}
}
Jerry Preissler
08/07/2023, 9:51 AMJerry Preissler
08/07/2023, 6:19 PMCies
08/09/2023, 9:34 AMJerry Preissler
08/09/2023, 11:52 AMA super-template is called explicitly by a template (or another super-template):That sounds very interesting. Is this public somewhere?
Cies
08/15/2023, 1:55 PM