Difference between revisions of "Liquid Template Variables - header"

From Spiffy Stores Knowledge Base

m (Created page with 'The liquid template variable ''header'' has the following attributes: == <code>header.author</code> == == <code>header.copyright</code> == == <code>header.description</code> =…')
 
m
 
(4 intermediate revisions by the same user not shown)
Line 1: Line 1:
The liquid template variable ''header'' has the following attributes:
+
The Liquid template variable '''header''' has the following attributes:
 +
 
 +
These variables should all appear within the <head> section in your [[Theme.liquid | theme.liquid]] file.
 +
 
 +
<pre>
 +
<head>
 +
...
 +
{{ header.author }}
 +
{{ header.copyright }}
 +
{{ header.description }}
 +
{{ header.keywords }}
 +
...
 +
 
 +
</head>
 +
</pre>
  
 
== <code>header.author</code> ==
 
== <code>header.author</code> ==
 +
 +
This variable generates a
 +
 +
<pre><meta name="author" content="Content by your store..."></pre>
 +
 +
This is used to specify the authorship of the page's content and design.
  
 
== <code>header.copyright</code> ==
 
== <code>header.copyright</code> ==
 +
 +
This variable generates a
 +
 +
<pre><meta name="copyright" content="Content Copyright (c) 2010 by your store..."></pre>
 +
 +
This is used to specify the copyright of the page's content and design.
  
 
== <code>header.description</code> ==
 
== <code>header.description</code> ==
 +
 +
This variable generates a
 +
 +
<pre><meta name="description" content="page description..."></pre>
 +
 +
The page description varies by page type. For product pages, a short description is included based upon the product description and vendor and product type.
 +
 +
Similarly, collections pages use the description of the collection.
 +
 +
Pages, Blogs and Articles extract a description from the page content, and in addition, Blog Articles include the author and the time the article was published.
 +
 +
These descriptive attributes are tagged and search engines can use the information to produce meaningful snippets for use in search results.
 +
 +
== <code>header.plain_description</code> ==
 +
 +
This variable generates a
 +
 +
<pre><meta name="description" content="page description..."></pre>
 +
 +
This variable is similar to the <code>description</code> variable, but all descriptions are generated without the additional tagged attributes that are generated by <code>description</code>.
  
 
== <code>header.keywords</code> ==
 
== <code>header.keywords</code> ==
 +
 +
This variable generates a
 +
 +
<pre><meta name="keywords" content="key1,key2,key3..."></pre>
 +
 +
The keywords are generated from the tags that are associated with the product or collection being displayed.
 +
 +
Generally, the keywords meta tag is not used by search engines.
 +
 +
== Further Reference ==
 +
 +
* [[Liquid Basics]]
 +
* [[Liquid Tag Reference]]
 +
* [[Liquid Filter Reference]]
 +
* [[Liquid Variable Reference]]
 +
* [[Liquid Paginate Tag|Pagination ]]

Latest revision as of 12:17, 25 June 2018

The Liquid template variable header has the following attributes:

These variables should all appear within the <head> section in your theme.liquid file.

<head>
...
{{ header.author }}
{{ header.copyright }}
{{ header.description }}
{{ header.keywords }}
...

</head>

header.author

This variable generates a

<meta name="author" content="Content by your store...">

This is used to specify the authorship of the page's content and design.

header.copyright

This variable generates a

<meta name="copyright" content="Content Copyright (c) 2010 by your store...">

This is used to specify the copyright of the page's content and design.

header.description

This variable generates a

<meta name="description" content="page description...">

The page description varies by page type. For product pages, a short description is included based upon the product description and vendor and product type.

Similarly, collections pages use the description of the collection.

Pages, Blogs and Articles extract a description from the page content, and in addition, Blog Articles include the author and the time the article was published.

These descriptive attributes are tagged and search engines can use the information to produce meaningful snippets for use in search results.

header.plain_description

This variable generates a

<meta name="description" content="page description...">

This variable is similar to the description variable, but all descriptions are generated without the additional tagged attributes that are generated by description.

header.keywords

This variable generates a

<meta name="keywords" content="key1,key2,key3...">

The keywords are generated from the tags that are associated with the product or collection being displayed.

Generally, the keywords meta tag is not used by search engines.

Further Reference