Download the PHP package daun/statamic-latte without Composer
On this page you can find all versions of the php package daun/statamic-latte. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package statamic-latte
Statamic Latte
Use the Latte templating language on Statamic sites.
✨ Features
- Render
.latte
views - Use Statamic's built-in tags and modifiers
- Resolve the current layout from entry data
- Render Antlers inline where useful
🛠️ Installation
Run the following command from your project root:
Alternatively, you can search for this addon in the Tools > Addons
section of
the Statamic control panel and install it from there.
🎨 Usage
Once installed, you're ready to use Latte views in your frontend. Just save or rename your views
using the extension .latte
and reference them as usual. Of course, you can use both side-by-side
as long as you're making sure there's only ever one identically named view.
Antlers
Latte
Tags
Statamic Tags can be used via the s
helper function:
Antlers
Latte
Modifiers
Statamic Modifiers can also be used as filters in Latte:
Antlers
Latte
Mix & Match
If you ever need to combine Latte and Antlers code, you can use the antlers
tag in your
Latte views to render Antlers code inline. This can be useful for complex built-in tags or quick
prototyping by copy-pasting examples from the docs.
Layout
Just like in Antlers templates, the correct layout file will be used based on the data available in your entries and blueprints.
By default, it will look for /resources/views/layout.latte
, but you can configure specific entries
and collections to use different layouts instead by setting layout: other_layout
on the entry or
collection config file.
Caching
Cache
Use the cache
tag to cache parts of a view.
Nocache
The nocache
tag can be used to exempt part of a view from
static caching.
Limitations
The nocache
tag is only supported for application-level static caching. Full file-based caching
requires JavaScript for nocache
to work, which isn't yet implemented in this addon. See
Caching Strategies for details.
Nesting cache
and nocache
is also not yet supported. The following will not work:
License
All versions of statamic-latte with dependencies
daun/laravel-latte Version ^1.0
laravel/framework Version ^9.0 || ^10.0 || ^11.0 || ^12.0
statamic/cms Version ^4.0 || ^5.0