e.g.
{{#typeBoxHasCharacters}}
…
{{/typeBoxHasCharacters}}
or
{{^typeBoxHasCharacters}}
…
{{/typeBoxHasCharacters}}
Is there any way this is already possible …
e.g.
{{#typeBoxHasCharacters}}
…
{{/typeBoxHasCharacters}}
or
{{^typeBoxHasCharacters}}
…
{{/typeBoxHasCharacters}}
Is there any way this is already possible …
Try something like this:
<script>
if(document.querySelector("#typeans").value) {
// typebox contains something
} else {
// ...
}
</script>
Thanks for replying; this doesn’t look too noob-friendly …
The problem I’m trying to solve:
{{type:answer}} <br>
{{answer}} <br>
If I don’t type the answer (90%+ of cases), it’s still displayed twice; not a real problem, but annoying …
If I remove the {{answer}}
tag, then any additional emphasis (bold is this case) will be lost, which IS a real problem …
Just realized your question is about the back template. This won’t actually work then. Try this instead:
{{type:answer}}
{{answer}}
<script>
(() => {
const typeans = document.querySelector("#typeans")
if(!typeans.querySelector("#typearrow")) {
typeans.remove();
}
})();
</script>
Just tried this; seems to work fine, thanks
In fact, this is so cool that it might as well work like this ‘out of the box’, IMHO …