https://kotlinlang.org logo
#ktor
Title
# ktor
ł

Łukasz Kłosiński

11/18/2021, 8:54 PM
I am trying to send the generated Template<FlowContent> as a text response (I do not want to send the full HtmlTemplate). So far I have got below:
Copy code
fun Route.test() {
    get("/test") {
        call.respondText(
            buildString {
                appendHTML().div {
                    insert(TestTemplate(), TemplatePlaceholder())
                }
            }
        )
    }
}
To make it work I have to wrap my TestTemplate in another div.
Copy code
<div>
  <div>this is the element I want to get, without the outer element</div>
</div>
Is there a way of doing it so I can send the actual template only, so I can get below:
Copy code
<div>this is the element I want to get, without the outer element</div>
2 Views