Reference
Blade helpers
Every helper, directive and component for block views and layouts.
Every helper, directive and component Aurora gives block views and layouts. They're global, so views need no @php use … imports. How to use them is under Block views and helpers.
Helpers
| Helper | Returns |
|---|---|
inline_text($text) | Text, escaped, with *highlighted* words |
plain_text($text) | Text, escaped, line breaks kept |
rich_text($html) | Rich text from a RichEditor, cleaned |
shows_field($field, $value) | Whether to draw an optional field: when it's filled, or when the canvas is editing |
link_href($data, $prefix = 'link') | The address of a Fields::link() group: a page, a file or a URL |
link_target($data, $prefix = 'link') | _blank when the link opens in a new tab, otherwise null |
is_editing() | Whether the block is drawn on the canvas |
block_slot($name) | A container block's slot, with the blocks in it |
current_page() | The page being drawn, or null in the palette's preview of a block |
block_depth() | 0 straight on the page, 1 inside one block, and so on |
is_nested_block() | Whether the block is inside another block |
Directives
| Directive | Does |
|---|---|
@editable('field') | Makes the element editable on the canvas, for a field in editables(); nothing elsewhere |
@editableItem('items', $index, 'field') | The same for a field inside a repeater's item, declared in itemEditables() (since 1.2.1) |
@inlineText(…), @plainText(…), @richText(…) | Print what the helper of the same name returns |
@linkHref($data), @linkTarget($data) | Print a link's address and target |
@blockSlot('content') | Prints a slot (not @slot: Blade's components use it) |
@blockDepth | Prints the block's depth |
@editing … @else … @endediting | Only on the canvas, or only elsewhere |
@shows('body', $data['body'] ?? null) … @endshows | Only when the field should be drawn |
@nested … @endnested | Only inside another block |
Components
| Component | Draws |
|---|---|
<x-aurora::blocks :page="$page" /> | A page's blocks, in the language being shown. Attributes go on the element around them; :blocks="$blocks" draws a list of blocks instead |
<x-aurora::media :value="…" size="md" /> | A media library image, responsive (sizes), with the block's crop and the focal point |
<x-aurora::layout :title="…">…</x-aurora::layout> | A website route's own content in one of the site's layouts, where a page's blocks would be. Also description, layout, :settings and noindex (since 1.2.2; see Routing) |