Preview Entries with Live Look

Before publishing content, many authors and editors like to double-check that it looks the way they expect it to look on the front-end. Live Look lets you do just that, and it’s pretty easy to set up.

First, duplicate the template you’re using to display a single entry, and give it a name like entry-preview. You’ll need to make a few tweaks to this template so that you can preview entries that aren’t yet published or might be set to publish in the future. Make sure the Channel Entries tag can display entries with a draft status and those that are dated in the future:

{exp:channel:entries
    channel
="news"
    
limit="1"
    
status="draft"
    
require_entry="yes"
    
show_future_entries="yes"
}

    {if no_results} {redirect
="404"} {/if}

    
<h1>Draft{title}</h1>

    
{article_content}

{
/exp:channel:entries} 

Under Admin ‣ Channel Administration ‣ Statuses in the CP, add a status named “Draft” to the status group being used by this Channel. Now open up the preferences for the relevant Channel (found under Admin ‣ Channel Administration ‣ Channels), select the entry-preview template you created earlier as the Live Look Template, and set Default Status to “Draft”.

Now on the entries edit page (Content ‣ Edit) you’ll see a new “View” link next to each entry in this Channel, and you’ll also see a “Live Look” link on the confirmation page after saving an entry.1 Click either link to see the entry presented just like it will be when published.

1 Both links have a URL that includes the entry ID rather than the entry’s URL title since the author may decide to change it during the drafting process. Be sure the Channel Entries tag in your Live Look template doesn’t rely on the URL title being in the URL.

.(JavaScript must be enabled to view this email address) or share your feedback on this entry with @ellislab on Twitter.