Reading query parameter in 3scale/Liquid

101 views
Skip to first unread message

4integ...@gmail.com

unread,
Apr 13, 2018, 6:04:43 AM4/13/18
to 3Scale API Management by Red Hat
Hi,

I'm new to liquid and working on a few pages to show APIs and navigate.

I want to browse all APIs in one page with links containing API service.id as query parameter 
When clicking on the link I get to a another page with API details (plans, signup etc).

What is the best 3scale way of doing this and passing/reading query parameters? 

/ Joacim

4integ...@gmail.com

unread,
Apr 19, 2018, 2:32:48 AM4/19/18
to 3Scale API Management by Red Hat
Since there was no discussion here - I got assistance from the support :)

Here is how to read query parameters:

{% assign params = request.request_uri %} {% if params contains '?service_id=' %} {% assign service_id = params | split: '?service_id=' | last | split: '&amp;' | first %} {% elsif params contains '&amp;service_id=' %} {% assign service_id = params | split: '&amp;service_id=' | last | split: '&amp;' | first %} {% endif %} <h1> Service Id: {{ service_id }} </h1> -----> example

/ Joacim

pim.g...@gmail.com

unread,
May 28, 2018, 7:57:15 AM5/28/18
to 3Scale API Management by Red Hat
Very nice thanks for sharing

Op donderdag 19 april 2018 08:32:48 UTC+2 schreef 4integ...@gmail.com:
Reply all
Reply to author
Forward
0 new messages