0

I'm working on an EE2 site (yes I know it's old) and we have a super search search results page that displays results from one particular category based on the url.

What I need to do is get the category id from the url which looks like this:

https://domain.com/articles/results/search&keywords=&category=COVID-19&catId=799/

Once I have that I can display the category info. Is there a way to do this?

Have tried mo variables but this -- {get:catId} -- outputs -- -- so I can't work with that.

1

I solved this by adding a ? just before catId=799 and then mo variables worked as expected.

| improve this answer | |
0

Your working solution is not correct.

To avoid confusion for anyone finding this I'm adding this additional answer.

The URI standard says that you should start a query element of a URI with the ? symbol. Subsequently you can separate multiple elements of your query using one of several delimiters, & and ; both are common and work.

So to be correct your URL should have the format:

https://domain.com/articles/results/search?keywords=&category=COVID-19&catId=799/

I'm not sure why putting the ? half-way through the variables works at all, but presumably mo'variables is scanning the URL for the ? and turning what follows into variables. I'm guessing with your solution you cannot retrieve the value for category or keywords.

Anyhow, HTH...

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.