Navigare Breadcrumb
From Katapulta
(Difference between revisions)
m |
m |
||
Line 88: | Line 88: | ||
<pre class="output"> | <pre class="output"> | ||
{% set page_title = vendor.title %} | {% set page_title = vendor.title %} | ||
+ | ... | ||
+ | </pre> | ||
+ | '''collection.html''' | ||
+ | |||
+ | |||
+ | <pre class="output"> | ||
+ | {% set page_title = collection.title %} | ||
+ | ... | ||
+ | </pre> | ||
+ | '''frontpage.html''' | ||
+ | |||
+ | |||
+ | <pre class="output"> | ||
+ | {% set page_title = 'Pagina principala' %} | ||
+ | ... | ||
+ | </pre> | ||
+ | '''page.html''' | ||
+ | |||
+ | |||
+ | <pre class="output"> | ||
+ | {% set page_title = page.title %} | ||
+ | ... | ||
+ | </pre> | ||
+ | '''post.html''' | ||
+ | |||
+ | |||
+ | <pre class="output"> | ||
+ | {% set page_title = post.title %} | ||
+ | ... | ||
+ | </pre> | ||
+ | '''postcategory.html''' | ||
+ | |||
+ | |||
+ | <pre class="output"> | ||
+ | {% set page_title = category.title %} | ||
+ | ... | ||
+ | </pre> | ||
+ | '''product.html''' | ||
+ | |||
+ | |||
+ | <pre class="output"> | ||
+ | {% set page_title = product.title %} | ||
... | ... | ||
</pre> | </pre> |
Revision as of 12:23, 16 September 2011
Acest tutorial explică în continuare cum se poate crea o navigare de tip breadcrumb magazinului tău.
Crează în tema ta un fișier de tip widget cu numele breadcrumbs.html (numele fisierului poate fi și altul) conținând următorul cod:
<div id="breadcrumb" class="clearfix"> <a href="/" title="Înapoi pe pagina principală">Acasă</a> {% if product is defined %} {% if collection is defined %} <span class="separator">»</span> <a href="{{ collection.url }}">{{ collection.title }}</a> {% elseif catalog is defined %} <span class="separator">»</span> <a href="/collection/catalog">Catalog</a> {% elseif product_type is defined %} <span class="separator">»</span> <a href="{{ product_type.url }}">{{ product_type.title }}</a> {% elseif vendor is defined %} <span class="separator">»</span> <a href="{{ vendor.url }}">{{ vendor.title }}</a> {% endif %} {% elseif post is defined %} <span class="separator">»</span> <a href="/blog">Blog</a> {% if category is defined %} <span class="separator">»</span> <a href="{{ category.url }}">{{ category.title }}</a> {% endif %} {% elseif category is defined %} <span class="separator">»</span> <a href="/blog">Blog</a> {% endif %} <span class="separator">»</span> <span class="page-title"> {% if page_title is defined %} {{ page_title }} {% else %} page_title variable is not defined for this template. {% endif %} </span> </div>
Editează fiecare fișier de tip template pentru setarea variabilei page_title. Setarea variabilei page_title se face pe prima linie din cadrul fiecărui template, astfel:
404.html
{% set page_title = 'Eroare 404' %} ...
blog.html
{% set page_title = 'Blog' %} ...
cart.html
{% set page_title = 'Cosul de cumparaturi' %} ...
catalog.html
{% set page_title = 'Catalog' %} ...
collection-by-type.html
{% set page_title = product_type.title %} ...
collection-by-vendor.html
{% set page_title = vendor.title %} ...
collection.html
{% set page_title = collection.title %} ...
frontpage.html
{% set page_title = 'Pagina principala' %} ...
page.html
{% set page_title = page.title %} ...
post.html
{% set page_title = post.title %} ...
postcategory.html
{% set page_title = category.title %} ...
product.html
{% set page_title = product.title %} ...