Difference between revisions of "Liquid Template Variables - request"
From Spiffy Stores Knowledge Base
m |
|||
Line 1: | Line 1: | ||
− | The | + | The Liquid template variable '''request''' has the following attributes: |
== <code>request.''parameter''</code> == | == <code>request.''parameter''</code> == |
Revision as of 12:45, 6 November 2013
The Liquid template variable request has the following attributes:
Contents
request.parameter
You can access any request parameter by name.
For example, a URL can include a parameter:
http://storedemo.spiffystores.com/?theme=blue
This theme parameter can be accessed by
request.theme
request.host
Returns the host name portion of the URL request.
For example, if we go to http://storedemo.spiffystores.com, then the request.host returns:
storedemo.spiffystores.com
request.url
Returns the complete URL used for this request.
For example, if we go to http://storedemo.spiffystores.com/products/widget, then the request.url returns:
http://storedemo.spiffystores.com/products/widget
request.remote_ip
Returns the IP address of the client accessing the page.
request.country
Returns the Country name of the client accessing the page. This information is determined from the IP address, and may not be accurate in all cases. Typically, the results are 99.5% accurate.
The name returned is the ISO Printable name. For example
Australia
request.country_code
Returns the two character ISO Country Code of the client accessing the page. This information is determined from the IP address, and may not be accurate in all cases. Typically, the results are 99.5% accurate.
The code returned is the ISO Code. For example
AU
request.city
Returns the City name of the client accessing the page. This information is determined from the IP address, and may not be accurate in all cases. Typically, the results are 79% accurate.
For example
Sydney
request.timezone
Returns the Time Zone of the client accessing the page. This information is determined from the IP address, and may not be accurate in all cases.
The name returned is the standard timezone name. For example
Australia/Sydney