...
site.name
Returns the site name
site.site_id
Returns the site’s id
site.domain
Returns the site’s primary full domain. E.g. www.my-plate-site.com.
site.attachments
Returns all
site.content_objects.[:plural_content_type_name]
...
You can also get all elements of a site in a collection: site.elements.all
site.trays
Returns all trays from a site.
site.[:plural_post_type_name]
Returns a collection with all posts (objects with the specified post type). E.g. {{ site.pages }}
returns a collection with all posts with the content type ‘page’.
site.post_types
Returns an array of liquid drops from all post_types in a site.
You can also loop through the array as follows:
Code Block |
---|
{% for post_type in site.post_types %}
{{post_type.title}}
{% endfor %} |
site.element_types
Returns all element types of a site.
site.section_types
Returns all section types of a site.
site.abstract_content_types
Returns all abstract content types of a site.
site.content_types
Returns all content types from a site.
site.languages
Returns an array of objects representing the available languages for the site.
...
The url attribute returns the url of the translation for the Post you are on. If there is no translation found, the root url for the language is returned. E.g. ‘/en’ for English, ‘/fr’ for French, and so on.
Input:
Code Block |
---|
{% for language in site.languages %} <a href="{{ language.url }}">{{ language.name }}</a> {% endfor %} |
Output:
Code Block |
---|
<a href="/dutch-url">Dutch</a> <a href="/en/english-url">English</a> <a href="/de">German</a> <!-- uses root german url if no translation is found !> |