====== Liquid Templates ======
Built on the [[Liquid]] markup language, Liquid templates are what tell SandwichBoard how to render restaurants' web sites. What follows is a detailed description of each template found in a [[themes|SandwichBoard theme]].
===== layout.liquid =====
This is the outermost template for a site. This is where the restaurant name, logo, site navigation, and copyright information would typically go. All other templates and pages are rendered inside it and are called by ''%%{{content_for_layout}}%%''.
Example:
{{ restaurant.stats_tracker }}
===== menu.liquid =====
Every menu's web page is generated by this template. You use the ''menu'' [[menu drop|Liquid drop]] and its attributes to build the resulting page detailing the menu.
Example:
===== error.liquid =====
If a Liquid template generates an error or if a user navigates to a page that doesn't exist, this template is used to tell the user that something has gone awry. You can access the Liquid error ''message'' from this template.
Example:
An error has occurred
{{ message }}
===== locations.liquid =====
This template is used to build the web page that displays a concise list of all a restaurant's locations. You use the ''locations'' Liquid collection, its [[location drop|location Liquid drops]], and their attributes to build the resulting page.
Example:
===== location.liquid =====
Every restaurant location's web page is generated by this template. You use the ''location'' [[location drop|Liquid drop]] and its attributes to build the resulting page detailing the location and its hours of operation.
Example:
{% endif %}
{% for schedule in location.schedules %}
{{ schedule.name }}
{% for entry in schedule.entries %}
{{ entry.days }}
{{ entry.hours }}
{% endfor %}
{% endfor %}
{% if location.notes %}
Additional Information
{{ location.notes | simple_format }}
{% endif %}
===== albums.liquid =====
This template is used to build the web page that displays a concise list of all a restaurant's albums. You use the ''albums'' Liquid collection, its [[album drop|album Liquid drops]], and their attributes to build the resulting page.
Example:
===== album.liquid =====
Every restaurant album's web page is generated by this template. You use the ''album'' [[album drop|Liquid drop]] and its attributes to build the resulting page showing the album and its images.
Example:
{% if album.date or album.description %}
{% if album.date %}
{{ album.date | date: '%B %e, %Y' }}
{% endif %}
{% if album.date %}
{{ album.description }}
{% endif %}
{% endif %}
{% for image in album.images %}
{% endfor %}
===== image.liquid =====
Every album's image web page is generated by this template. You use the ''image'' [[album drop|Liquid drop]] and its attributes to build the resulting page showing the image and its comments.
Example:
{{ comment.body }}