2017 © Pedro Peláez
 

craft-plugin preview-button

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

image

biglotteryfund/preview-button

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

  • Wednesday, March 7, 2018
  • by mattandrews
  • Repository
  • 1 Watchers
  • 1 Stars
  • 431 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 1 Open issues
  • 3 Versions
  • 62 % Grown

The README.md

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

Craft 3.2 saw the release of "headless preview" 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: https://nystudio107.com/blog/headless-preview-in-craft-cms, (*1)

Preview Button plugin for Craft CMS 3.x

Adds a preview button to the entry editor screen to allow previewing of draft/revision entries, (*2)

Logo, (*3)

Requirements

This plugin requires Craft CMS 3.0.0-beta.23 or later., (*4)

Installation

To install the plugin, follow these instructions., (*5)

  1. Open your terminal and go to your Craft project:, (*6)

    cd /path/to/project
  2. Then tell Composer to load the plugin:, (*7)

    composer require biglotteryfund/preview-button
  3. In the Control Panel, go to Settings → Plugins and click the “Install” button for Preview Button., (*8)

Preview Button Overview

Sites that make use of the 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., (*9)

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., (*10)

Configuring Preview Button

There are three settings:, (*11)

Logo, (*12)

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)., (*13)

2. Version URL parameter (optional)

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

3. Draft URL parameter (optional)

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

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:, (*16)

Logo, (*17)

Preview Button Roadmap

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

--, (*19)

Brought to you by Big Lottery Fund, (*20)

The Versions

07/03 2018

dev-master

9999999-dev

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

  Sources   Download

MIT

The Requires

 

cms craftcms craft-plugin craft preview button

07/03 2018

1.0.2

1.0.2.0

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

  Sources   Download

MIT

The Requires

 

cms craftcms craft-plugin craft preview button

06/02 2018

1.0.0

1.0.0.0

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

  Sources   Download

MIT

The Requires

 

cms craftcms craft-plugin craft preview button