Keyword replacement when GET variable has special character


(Michael Wilson) #1

Matrix Version:
v5.5.4.2

I have a REST Resource nested on a page and I’m supplying some Additional GET Parameters. One of these parameters takes the form: f.Category%7CFBCategory=

Placing f.Category%7CFBCategory in the Variable Value field breaks the page as does f.Category|FBCategory. Any ideas how to handle special characters here?

Thanks,
Michael


(Iain Simmons) #2

I might be misunderstanding what you’re trying to achieve, but shouldn’t that be the Variable Name (key)?

Also, what is the keyword you’re using in the REST Resource to get the value of that variable?

You could try doing the following in JS processing part of the REST Resource to see what is happening:

print('%globals_get%');

(Michael Wilson) #3

My REST Resource has the following:

URL(S): https://search.wagga.nsw.gov.au/s/search.html?%globals_get^as_url_string%

Then the page nesting this asset provides the params:

VARIABLE NAME VARIABLE VALUE
collection wagga-web
profile embed
query %globals_get_query%
start_rank %globals_get_start_rank%
f.Category FBCategory

(Iain Simmons) #4

Perhaps try:
https://search.wagga.nsw.gov.au/s/search.html?%nested_get^as_url_string%


(Michael Wilson) #5

That didn’t work unfortunately. Also I noticed in my pasted table of settings above, the last row hasn’t pasted very well. It should have been:

f.Category|FBCategory %globals_get_f.Category%7CFBCategory%


(Iain Simmons) #6

What if that one is %globals_get_f.Category|FBCategory%?


(Michael Wilson) #7

Same error. Breaks the search and I can see the globals_get keyword replacement on the page so it hasn’t been able to execute the replacement.


(Bart Banda) #8

The values you are getting as %globals_get_X% you don’t need to pass as dynamic variables in the Nested Asset, you could simply just add these directly to the REST asset’s URL field to see if that makes a difference?

URL(S): https://search.wagga.nsw.gov.au/s/search.html?query=%globals_get_query%....etc

Note that %globals_get^as_url_string% in the REST asset URL field will look for query strings at the frontend top level, not from your nested asset passing them down.