1

I'm trying to get the value of a query string in the URL. I stumbled onto {current_query_string} which displays the whole query string. But i'm looking to get everything after the =.

{resource_tags backspace="5"}
   <a href="/segment_name_here?tag_id={tag_id}">{tag}</a>
{/resource_tags}

Basically i just want to get the {tag_id} part from the url so i can display a list of entries based on the {tag_id}.

So if the url is /segment_name_here?tag_id=44 i just want the number 44

1 Answer 1

1

If your currently running on ExpressionEngine 6 you should be able to use the Request add-on (shipped as part of the core) to grab the GET variable. Should be something along the following lines.

{exp:request:get name="tag_id"}

https://docs.expressionengine.com/latest/add-ons/request.html#request

Without seeing the template, there may also be a way to pass the tag id as a segment.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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