Liquid Template Variables - request: Difference between revisions

From Spiffy Stores Knowledge Base
Jump to: navigation, search
Admin (talk | contribs)
Admin (talk | contribs)
No edit summary
Line 1: Line 1:
The liquid template variable ''request'' has the following attributes:
The liquid template variable ''request'' has the following attributes:
== <code>request.''parameter''</code> ==
You can access any request parameter by name.
For example, if a URL includes a parameter:
<pre>http://storedemo.spiffystores.com/?theme=blue</pre>
This ''theme'' parameter can be accessed by
<pre>request.theme</pre>


== <code>request.host</code> ==
== <code>request.host</code> ==

Revision as of 17:49, 16 September 2008

The liquid template variable request has the following attributes:

request.parameter

You can access any request parameter by name.

For example, if a URL includes 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.remote_ip

Returns the IP address of the client accessing the page.