Difference between revisions of "Liquid Template Variables - request"
From Spiffy Stores Knowledge Base
m (→request.url) |
|||
Line 32: | Line 32: | ||
Returns the IP address of the client accessing the page. | Returns the IP address of the client accessing the page. | ||
+ | |||
+ | == <code>request.country</code> == | ||
+ | |||
+ | 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 | ||
+ | |||
+ | <pre> | ||
+ | Australia | ||
+ | </pre> | ||
+ | |||
+ | == <code>request.country_code</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 | ||
+ | |||
+ | <pre> | ||
+ | AU | ||
+ | </pre> | ||
+ | |||
+ | == <code>request.city</code> == | ||
+ | |||
+ | 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 | ||
+ | |||
+ | <pre> | ||
+ | Sydney | ||
+ | </pre> | ||
+ | |||
+ | == <code>request.timezone</code> == | ||
+ | |||
+ | 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 | ||
+ | |||
+ | <pre> | ||
+ | Australia/Sydney | ||
+ | </pre> |
Revision as of 10:39, 26 January 2011
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