You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Dec 27, 2021. It is now read-only.
The markdown filter allows you to convert MarkDown to HTML. It's important to output the resulting output using the raw filter to output the resulting HTML; otherwise it will be escaped.
Images
Item
Description
.fit(x,y)
Resizes image down to fit the given dimensions. Does not upscale.
.fit(x)
Constrain only width
.fit(null,y)
Constrain only height
.fill(x,y)
Crops image to fit the given dimensions. Does not crop if the image is already smaller than the given dimensions.
.ratio(x,y)
Always crops image to match the ratio of the given dimensions, regardless of image's resolution.
.focalPoint
.focalPoint.x, .focalPoint.y; returns percent integer without the % sign.
Select a contrasting color (dark & light default to black & white)
su.editable
Item
Description
su.editable.region( (string) identifier )
Allows inline editing of a custom content region
su.editable.title
Allows inline editing of page title
Editable region identifer strings are most comonly named custom1, custom2, custom3, etc. custom1 almost always coincides with a layout's sidebar. Whenever possible, stick to this naming convention so that a user's page content remains visible when they switch to a layout with a sidebar in another theme.
su.media
Item
Description
su.media
Array of media items
su.media.tagGroup("Group Name").tag("Tag Name")
Array of media items associated with specified tag
mediaItem.assets
Array of assets
asset.url
Asset's URL
su.page
Item
Description
su.page("/url")
Get page by path
su.page.authors
su.page.breadcrumbs
su.page.children
Get a page's children
su.page.children(id)
Get a specific page's children. Inspect the /admin/page/list table to get the id.
su.page.content
Allows for things like {% raw %}{{ child.description ?: child.content|striptags|pretty_truncate(200) }}{% endraw %}
su.page.description
su.page.featuredImage
.fit(x,y), .fill(x,y), .ratio(x,y)
su.page.navigationLabel
su.page.parent
Parent of current page
su.page.posts
Get the posts associated with a blog page. Posts have the same content as pages (title, etc).
su.page.publishedAt
To format in Twig: {% raw %}`{{ su.page.publishedAt
su.page.target
su.page.thumbnail
su.page.title
Does not allow inline editing
su.page.topParent
Top parent of current page
su.page.updatedAt
To format in Twig: {% raw %}`{{ su.page.updatedAt
su.page.url
su.page.urlForCollectionItem( item )
Retrieve the URL for a collection item's detail page
su.page.collectionItem()
Retrieve current item on collection item detail page