PHPackages                             biglotteryfund/preview-button - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. biglotteryfund/preview-button

ActiveCraft-plugin[Utility &amp; Helpers](/categories/utility)

biglotteryfund/preview-button
=============================

Adds a preview button to the entry editor screen to allow previewing of draft/revision entries

1.0.4(6y ago)33.9k2[1 PRs](https://github.com/biglotteryfund/craft-preview-button/pulls)MITPHPCI failing

Since Feb 6Pushed 6y agoCompare

[ Source](https://github.com/biglotteryfund/craft-preview-button)[ Packagist](https://packagist.org/packages/biglotteryfund/preview-button)[ RSS](/packages/biglotteryfund-preview-button/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (5)Dependencies (1)Versions (5)Used By (0)

Note: this project is no longer maintained / usable beyond Craft CMS 3.2
------------------------------------------------------------------------

[](#note-this-project-is-no-longer-maintained--usable-beyond-craft-cms-32)

Craft 3.2 saw the release of "[headless preview](https://craftcms.com/blog/craft-32)" which effectively supersedes this plugin. Headless Preview is much more powerful than this plugin, and also makes it no longer work as draft entries are now dynamic (eg. use JavaScript to update the UI), which means our plain-ol' server-rendered button will no longer link to the right place. Our suggestion is to disable this plugin and modify your API calls to pass through the Craft preview tokens (which Just Work™) to your API – there's a good guide here:

Preview Button plugin for Craft CMS 3.x
=======================================

[](#preview-button-plugin-for-craft-cms-3x)

Adds a preview button to the entry editor screen to allow previewing of draft/revision entries

[![Logo](resources/img/logo.png)](resources/img/logo.png)

Requirements
------------

[](#requirements)

This plugin requires Craft CMS 3.0.0-beta.23 or later.

Installation
------------

[](#installation)

To install the plugin, follow these instructions.

1. Open your terminal and go to your Craft project:

    ```
     cd /path/to/project

    ```
2. Then tell Composer to load the plugin:

    ```
     composer require biglotteryfund/preview-button

    ```
3. In the Control Panel, go to Settings → Plugins and click the “Install” button for Preview Button.

Preview Button Overview
-----------------------

[](#preview-button-overview)

Sites that make use of the [Element API](https://github.com/craftcms/element-api) may not benefit from Craft's preview features if they're not making use of templating. This plugin adds a button to the Entry editing screen which links to a preview URL with `?draft=$id` or `?version=$id` parameters so your backend can look up content from the correct place.

It's your responsibility to write the backend code to fetch these revisions/drafts, but this plugin should allow you to give users a way to preview content directly from the editing screen.

Configuring Preview Button
--------------------------

[](#configuring-preview-button)

There are three settings:

[![Logo](resources/img/settings.png)](resources/img/settings.png)

### 1. URL base

[](#1-url-base)

This will replace your `siteUrl` for the entry's URI (eg. you may wish to serve preview content on a subdomain or subfolder of your main site).

### 2. Version URL parameter (optional)

[](#2-version-url-parameter-optional)

This will be appended to the preview URI along with the ID of the version, eg. `?version=$id`.

### 3. Draft URL parameter (optional)

[](#3-draft-url-parameter-optional)

This will be appended to the preview URI along with the ID of the draft, eg. `?draft=$id`.

Using Preview Button
--------------------

[](#using-preview-button)

Install the plugin, configure a URL base as a minimum, and edit an entry in draft/revision mode. You should see a button below the entry fields:

[![Logo](resources/img/preview.png)](resources/img/preview.png)

Preview Button Roadmap
----------------------

[](#preview-button-roadmap)

Possibly supporting more advanced URL construction and configuring which entry types or user roles can see the preview button.

\--

Brought to you by [Big Lottery Fund](https://www.github.com/biglotteryfund)

###  Health Score

33

—

LowBetter than 74% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity22

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity66

Established project with proven stability

 Bus Factor1

Top contributor holds 66.7% 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 ~204 days

Total

4

Last Release

2401d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/70ac4724d8c27f3393a8486c5bed8f2302c123f1f1e2f3130ca3a485d6b80104?d=identicon)[mattandrews](/maintainers/mattandrews)

---

Top Contributors

[![mattandrews](https://avatars.githubusercontent.com/u/394376?v=4)](https://github.com/mattandrews "mattandrews (8 commits)")[![davidrapson](https://avatars.githubusercontent.com/u/123386?v=4)](https://github.com/davidrapson "davidrapson (4 commits)")

---

Tags

cmsCraftcraftcmscraft-pluginpreview button

### Embed Badge

![Health badge](/badges/biglotteryfund-preview-button/health.svg)

```
[![Health](https://phpackages.com/badges/biglotteryfund-preview-button/health.svg)](https://phpackages.com/packages/biglotteryfund-preview-button)
```

###  Alternatives

[verbb/navigation

Create navigation menus for your site.

90683.7k17](/packages/verbb-navigation)[verbb/formie

The most user-friendly forms plugin for Craft.

101372.9k40](/packages/verbb-formie)[verbb/comments

Add comments to your site.

13753.1k](/packages/verbb-comments)[verbb/tablemaker

Create customizable and user-defined table fields.

40168.8k1](/packages/verbb-tablemaker)[supercool/tablemaker

Create customizable and user-defined table fields.

40141.7k](/packages/supercool-tablemaker)[pennebaker/craft-architect

CraftCMS plugin to generate content models from JSON/YAML data.

72148.5k5](/packages/pennebaker-craft-architect)

PHPackages © 2026

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