I've been attempting to load a value obtained from clicking a button into an if statement within my HTML template, but have hit a roadblock. Perhaps I'm approaching this the wrong way.
I tried utilizing the var tag and placing my variable inside it, but encountered issues when trying to modify it using JavaScript code.
{% for publication in page.get_children.specific %}
{% if publication.pub_type == <var id="varpubtype">pubtype</var> %}
{% if publication.pub_year == <var id="varpubyear">pubyear</var> %}
<tr>
<td>{{ publication.Authors }}</td>
<td>{{ publication.name }}</td
<td>{{ publication.pub_year }}</td>
<td>{{ publication.pub_journal }}</td>
<td>{{ publication.vol_issue }}</td>
<td>{{ publication.pages }}</td>
</tr>
{% endif %}
{% endif %}
{% endfor %}
Below is my script:
function toggletable(pubtypevar) {
document.getElementById("varpubtype").innerHTML = pubtypevar;
}
function toggleyear(pubyearvar){
document.getElementById('varpubyear').innerHTML = pubyearvar;
}
When I used var and span tags, I encountered a template error stating: 'Could not parse the remainder:'