Hi @Verceti87 ,
the request.params collection contains the get parameters which are sent along with the request.
so, if the url is https://<myportalurl>/<myportalpage>/?a=42&vegetable=cucumber&cid=01234567-abcd-bcde-cdef-0123456789ab the request.params collections can be accessed like this:
{% assign mya = request.params["a"] %} {%- comment -%}mya will contain 42 (as a string) now{%- endcomment -%}
{% assign myvegetable = request.params["vegetable"] %}{%- comment -%} myvegetable will contain the string cucumber{%- endcomment -%}
{% assign mycid = request.params["cid"] %}{%- comment -%} mycid will contain the string 01234567-abcd-bcde-cdef-0123456789ab{%- endcomment -%}
So, using request.params.id does not really make sense when the url does not contain a get parameter called id,
You can check the presence of the id by {% if request.params.id %} . May colleagues prefer {% assign myid = request.params.id | default: "noidpresent" %} and then somewhere in the code {% if myid = "noidpresent" %}...{% else%}...{%endif%}
Its a matter of taste and style 🙂
Hope this helps and is the answer to the question 🙂
Christian
PS i never checked what happens if you pass in ...&a=1&a=2&a=3. I think, in asp.net you would get an array as parameters. But i never tried in portals. When i want wo pass in many values i usually use somtehing like ...&a=1,2,3 and somewhere in the code {% assign myas = request.params.a | split: "," %} to get an iterable for the a's 🙂