Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

Add practical examples showing facade alternatives to Antlers tags

Aperta
#1,770 0 commenti 1 reazione 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
42/100
Tipo di issue
Documentazione
Chiarezza
Abbastanza chiara
Stato di attività
Ferma
Stack tecnologico
laravel, php
Ambito
documentation

Direzione di ricerca

Start with the Blade documentation sections covering Antlers Blade Components and fluent tags, then locate the relevant facade API references for Glide, collections, taxonomies, and navigation. Add practical facade examples for common Antlers tags and explain when they suit simple data access; done means the Blade docs show clear, accurate equivalents for the examples in the issue.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

The current Blade documentation shows two approaches for using Statamic features in Blade:

  1. Antlers Blade Components (<s:glide>) - verbose for simple use cases
  2. Fluent tags (Statamic::tag('glide')) - awkward syntax, not discoverable

However, there's a cleaner approach using facades that isn't documented at all.

For example: Image Manipulation (Glide), the docs currently show:

{{-- Using fluent tags --}}
<img src="{{
 Statamic::tag('glide')->src('test.png')->width(1280)->height(800)->fetch() }}"
/>

{{-- Using Antlers Blade Components --}}
<s:glide src="test.png" width="1280" height="800">
 <img src="{{ $url }}" />
</s:glide>

The second approach is clunky if you're just wanting the URL, so you're forced to use Statamic::tag() everywhere if you just want the data, but there's a much cleaner facade approach that isn't documented:

<img src="{{ Image::manipulate('test.png', ['w' => 1280, 'h' => 800]) }}" />

I prefer using Facades because it's more Laravel-like and familiar to developers, and also better IDE autocomplete support. It's also a cleaner syntax for simple use cases.

Suggestion

The Blade documentation should include a section showing facade equivalents for common Antlers tags. For example:

Collections:

// Instead of: Statamic::tag('collection:wheels')->limit(3)
Collection::findByHandle('wheels')->queryEntries()->limit(3)->get()

Taxonomies:

// Instead of: <s:taxonomy:categories>
Taxonomy::findByHandle('categories')

Navigation:

// Instead of: <s:nav:main>
Nav::find('main')->tree()

This would help developers transitioning from Antlers or building custom Blade components discover the most appropriate API for their needs.

Lingua principale
PHP
Stelle
133
Fork
405
Merge medio
21h 45m
PR unite (30g)
12

Preparare l'ambiente

Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di statamic/docs

Tutte le issue di statamic/docs

Issue simili

Altre issue su PHP

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.