Sha256: a20138741f114f288aca829dd1e65c3c4f606db5815c3d8ae16c3ffe411e21ca

Contents?: true

Size: 1.17 KB

Versions: 19

Compression:

Stored size: 1.17 KB

Contents

<h2>Special values</h2>

<h3><span class="function">site_url</span> - The base url for the website including protocol and port based on the current request.</h3>

<pre>
{{ site_url }} = http://testsite.com
</pre>

<h3><span class="function">content_for_layout</span> - Inserts the contents of a page that defines it as its layout page.</h3>

<p>If there's a page called "layout" that contains the following:</p>
<pre>
&lt;html&gt;
  {{ content_for_layout }}
&lt;/html&gt;
</pre>

<p>And a page called "content" that specifies "layout" as its layout page (done via the CMS UI):</p>
<pre>
&lt;div&gt;Content&lt;/div&gt;
</pre>

<p>This results in:</p>
<pre>
&lt;html&gt;
  &lt;div&gt;Content&lt;/div&gt;
&lt;/html&gt;
</pre>

<p>{{ content_for_layout }} can be nested in any number of pages to allow for layouts within layouts.</p>

<h3><span class="function">params</span> - The params value is available in all pages and contains all parameters passed to the page via a GET or POST request.</h3>

<p class="example">For a page request of /path/page?test=1</p>

<pre>
{{ params.test }} = 1
{{ params.url }} = pathpage
{{ params.url[0] }} = path
{{ params.url[1] }} = page
{{ params.url[2] }} = ''
</pre>

Version data entries

19 entries across 19 versions & 1 rubygems

Version Path
liquid_cms-0.3.2.0 app/views/cms/documentation/_special_vars.html.erb
liquid_cms-0.2.2.0 app/views/cms/documentation/_special_vars.html.erb
liquid_cms-0.2.1.1 app/views/cms/documentation/_special_vars.html.erb
liquid_cms-0.3.1.0 app/views/cms/documentation/_special_vars.html.erb
liquid_cms-0.2.1.0 app/views/cms/documentation/_special_vars.html.erb
liquid_cms-0.2.0.13 app/views/cms/documentation/_special_vars.html.erb
liquid_cms-0.3.0.10 app/views/cms/documentation/_special_vars.html.erb
liquid_cms-0.3.0.9 app/views/cms/documentation/_special_vars.html.erb
liquid_cms-0.2.0.12 app/views/cms/documentation/_special_vars.html.erb
liquid_cms-0.2.0.11 app/views/cms/documentation/_special_vars.html.erb
liquid_cms-0.2.0.10 app/views/cms/documentation/_special_vars.html.erb
liquid_cms-0.3.0.8 app/views/cms/documentation/_special_vars.html.erb
liquid_cms-0.2.0.9 app/views/cms/documentation/_special_vars.html.erb
liquid_cms-0.3.0.7 app/views/cms/documentation/_special_vars.html.erb
liquid_cms-0.3.0.6 app/views/cms/documentation/_special_vars.html.erb
liquid_cms-0.2.0.8 app/views/cms/documentation/_special_vars.html.erb
liquid_cms-0.3.0.5 app/views/cms/documentation/_special_vars.html.erb
liquid_cms-0.2.0.7 app/views/cms/documentation/_special_vars.html.erb
liquid_cms-0.3.0.4 app/views/cms/documentation/_special_vars.html.erb