3
Studying a little the Node-Red I came across the following expression, {{#header.url}
.
Several expressions of the type are present in the code, for example: {{/header.url}}
, {{#header.image}}
, etc. Follows a code snippet:
<span class="logo">{{#header.url}}<a href="{{.}}">{{/header.url}}{{#header.image}}<img src="{{.}}" title="{{version}}">{{/header.image}} <span>{{ header.title }}</span>{{#header.url}}</a>{{/header.url}}</span>
<ul class="header-toolbar hide">
Would anyone know what that expression is doing?
So for example, instead of me writing all the html to upload images, links and so on, I can set up the mustache so that it generates all this for me?
– Fernando Messias da Silva
@Fernandomessiasdasilva in particular mustache is very fanatical about logic. They "ban" logic in the template. If you can have the logic in JS and make the template show what you want great. Otherwise there are many other languages that do this. I think my answer goes against your question. If you have another specific question about a situation where you want to write html logically for images and links: I suggest you ask another question.
– Sergio