stoffelio/statamic-live-preview-tag

Adds Antlers tag to show or hide parts of templates in live preview mode.

Maintainers

Package info

github.com/stoffelio/statamic-live-preview-tag

Type:statamic-addon

pkg:composer/stoffelio/statamic-live-preview-tag

Statistics

Installs: 844

Dependents: 0

Suggesters: 0

Stars: 0

Open Issues: 0

v1.0.0 2022-02-19 05:12 UTC

This package is auto-updated.

Last update: 2026-03-19 14:12:02 UTC


README

Adds an Antlers tag to easily show or hide parts of your template when viewing the page in Statamic's live preview mode.

Purpose

Allows you to exclude things like tracking scripts or even parts of your content in live view.

How to Install

You can search for this addon in the Tools > Addons section of the Statamic control panel and click install, or run the following command from your project root:

composer require stoffelio/statamic-live-preview-tag

How to Use

Simply check if the request is a live preview using the tag:

{{ if {is_live_preview} }}
    this will be shown only in live preview
{{ else }}
    this will be hidden in live preview
{{ /if }}