PHPackages                             daun/statamic-latte - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Templating &amp; Views](/categories/templating)
4. /
5. daun/statamic-latte

ActiveStatamic-addon[Templating &amp; Views](/categories/templating)

daun/statamic-latte
===================

Use Latte templates on Statamic sites

1.3.0(1y ago)34721[1 issues](https://github.com/daun/statamic-latte/issues)MITPHPPHP ^8.1CI passing

Since Mar 10Pushed 1y ago1 watchersCompare

[ Source](https://github.com/daun/statamic-latte)[ Packagist](https://packagist.org/packages/daun/statamic-latte)[ RSS](/packages/daun-statamic-latte/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (7)Dependencies (9)Versions (11)Used By (0)

Statamic Latte
==============

[](#statamic-latte)

[![Latest Version on Packagist](https://camo.githubusercontent.com/8c11efe0dc028d2427ddf4a4c032749fd426c4e3593da40b851f4204439711f6/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6461756e2f73746174616d69632d6c617474652e737667)](https://packagist.org/packages/daun/statamic-latte)[![Test Status](https://camo.githubusercontent.com/6fa11ed1f0939ff3d04e3804b902e48143708c9df0be836ddf9f1c59ac5b6714/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f6461756e2f73746174616d69632d6c617474652f63692e796d6c3f6c6162656c3d7465737473)](https://github.com/daun/statamic-latte/actions/workflows/ci.yml)[![Code Coverage](https://camo.githubusercontent.com/4903475b6fb593151a2927db9b0322384d141f9a3c03298d2c843395cee897d9/68747470733a2f2f696d672e736869656c64732e696f2f636f6465636f762f632f6769746875622f6461756e2f73746174616d69632d6c61747465)](https://app.codecov.io/gh/daun/statamic-latte)[![License](https://camo.githubusercontent.com/2556183f7a0128050fba9661ad605b2324b85b57d9b4214d5d816cdf744e2426/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f6461756e2f73746174616d69632d6c617474652e737667)](https://github.com/daun/statamic-latte/blob/master/LICENSE)

Use the [Latte](https://latte.nette.org/en/) templating language on [Statamic](https://statamic.com/) sites.

✨ Features
----------

[](#-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
---------------

[](#️-installation)

Run the following command from your project root:

```
composer require daun/statamic-latte
```

Alternatively, you can search for this addon in the `Tools > Addons` section of the Statamic control panel and install it from there.

🎨 Usage
-------

[](#-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.

```
- /resources/views/project.antlers.html
+ /resources/views/project.latte
```

**Antlers**

```

    {{ songs }}
        {{ value }} (Next: {{ next:value }})
    {{ /songs }}

```

**Latte**

```

    {$song} (Next: {$iterator->nextValue})

```

### Tags

[](#tags)

[Statamic Tags](https://statamic.dev/tags) can be used via the `s` helper function:

**Antlers**

```
{{ collection:pages take="8" }}
  {{ title }}
{{ /collection }}
```

**Latte**

```
{foreach s('collection:pages', take: 8) as $entry}
  {$entry->title}
{/foreach}
```

### Modifiers

[](#modifiers)

[Statamic Modifiers](https://statamic.dev/modifiers) can also be used as filters in Latte:

**Antlers**

```
{{ title | upper | truncate(50) }}
```

**Latte**

```
{$title|upper|truncate:50}
```

### Mix &amp; Match

[](#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.

```
Rendered in Latte: {$title}

{antlers}
    Rendered in Antlers: {{ title }}
{/antlers}
```

### Layout

[](#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

[](#caching)

#### Cache

[](#cache)

Use the `cache` tag to cache parts of a view.

```
{cache for: '10 minutes'}
    {foreach $stocks as $stock}
        {$stock->fetchPrice()}
    {/foreach}
{/cache}
```

#### Nocache

[](#nocache)

The `nocache` tag can be used to exempt part of a view from [static caching](https://statamic.dev/static-caching).

```
{include 'partials.nav', handle: main}

{nocache}
    {if $logged_in}
        Welcome back, {$current_user->name}
    {else}
        Hello, Guest!
    {/if}
{/nocache}

{block content}{/block}
```

#### Limitations

[](#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](https://statamic.dev/static-caching#caching-strategies) for details.

Nesting `cache` and `nocache` is also not yet supported. The following **will not work**:

```
{cache}
    this will be cached
    {nocache}
        this will remain dynamic
    {/nocache}
    this will also be cached
{/cache}
```

License
-------

[](#license)

[MIT](https://opensource.org/licenses/MIT)

###  Health Score

32

—

LowBetter than 72% of packages

Maintenance37

Infrequent updates — may be unmaintained

Popularity17

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity56

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~60 days

Recently: every ~89 days

Total

7

Last Release

436d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/31ac2b3787ded290b6bac87b937abf4f267483e4da64731bfb256a942bb669ca?d=identicon)[daun](/maintainers/daun)

---

Top Contributors

[![daun](https://avatars.githubusercontent.com/u/22225348?v=4)](https://github.com/daun "daun (80 commits)")

---

Tags

lattestatamicstatamic-addontemplatesviewsnetteviewlattestatamic

###  Code Quality

TestsPest

Static AnalysisPHPStan

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/daun-statamic-latte/health.svg)

```
[![Health](https://phpackages.com/badges/daun-statamic-latte/health.svg)](https://phpackages.com/packages/daun-statamic-latte)
```

###  Alternatives

[contributte/latte

Extra contrib to nette/latte

111.5M2](/packages/contributte-latte)[stillat/antlers-components

2656.0k1](/packages/stillat-antlers-components)[nepada/form-renderer

Latte template based form renderer for Nette forms with full support for Bootstrap 3, 4 &amp; 5.

11251.0k](/packages/nepada-form-renderer)[marcorieser/statamic-livewire

A Laravel Livewire integration for Statamic.

2381.5k10](/packages/marcorieser-statamic-livewire)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
