Hello everyone,
I put this code in the "Header" web template of my website
{% assign paramid = request.params.id %}
<script type="text/javascript">
const paramID = "{{ paramid }}";
console.log(paramID)
</script>
And I found that once I open the page with that url one time. When I try to reload the page with the same url but another "id" parameter, the value of the "paramID" never changes. It will always be the value of the "id" parameter that I uses when I first open that window. I tried refreshing and I tried entering the url with a different "id" parameter but nothing changed.
I tried putting the code in the html file of the page and there was no problem. However the function that this code is a part of exist on every page. So I want the put this code in the "Header" web template.
Does anyone know what I did wrong here? What do I have to do to get the {{ request.params.id }} to return the current "id" url parameter?
Thank you in advance.