Difference between revisions of "Liquid Template Variables - link"

From Spiffy Stores Knowledge Base

(New page: The liquid template variable ''link'' has the following attributes: == <code>link.id</code> == Returns the unique internal number of the link. This is normally only for internal usage. ...)
 
Line 11: Line 11:
 
Returns the title of this link.
 
Returns the title of this link.
  
== <code>link.description</code> ==
+
== <code>link.url</code> ==
  
== <code>link.url</code> ==
+
The is the link's relative URL address.
  
 
== <code>link.object</code> ==
 
== <code>link.object</code> ==
 +
 +
Returns the object that the link points to, for example, a collection, a product, and so on.
 +
 +
This could be used to create an overview for related collections.
 +
 +
<pre>{% for link in linklists.gift-ideas.links %}
 +
  <div>
 +
  {{ link.object.products.first.image | product_image | link_to: link.object.url }} <br />
 +
  {{ link.title }}
 +
</div>
 +
{% endfor %}</pre>
  
 
== <code>link.type</code> ==
 
== <code>link.type</code> ==
 +
 +
Returns the type of the object in link.object.
  
 
== <code>link.links</code> ==
 
== <code>link.links</code> ==
 +
 +
Returns a collection of all of this link's children.
  
 
== <code>link.links_count</code> ==
 
== <code>link.links_count</code> ==
 +
 +
Returns the number of child links for this link.

Revision as of 16:09, 15 September 2008

The liquid template variable link has the following attributes:

link.id

Returns the unique internal number of the link.

This is normally only for internal usage.

link.title

Returns the title of this link.

link.url

The is the link's relative URL address.

link.object

Returns the object that the link points to, for example, a collection, a product, and so on.

This could be used to create an overview for related collections.

{% for link in linklists.gift-ideas.links %}
  <div>
  {{ link.object.products.first.image | product_image | link_to: link.object.url }} <br />
  {{ link.title }}
</div>
{% endfor %}

link.type

Returns the type of the object in link.object.

link.links

Returns a collection of all of this link's children.

link.links_count

Returns the number of child links for this link.