Just in Chronicles

Life as a Voyage

Enhanced Preview for Umbraco

leave a comment »

Existing preview function in Umbraco only supports actual pages, not contents shared within a website. This approach is logically correct as shared contents are not independent pages. However, there must be demands to preview shared contents before publishing them.

This Umbraco extension enables for content editors to preview what they have written and how the contents would be looking like, before they publish the contents.

Basic idea is simple. Umbraco provides an alternative template function by using AltTemplate querystring.

This extension allows users to assign certain document types to templates. So, when users click the preview button, this extension starts looking up the configuration values to for document type  – template mappings.

<enhancedPreviewConfiguration>
    <items>
        <clear />
        <add alias="Product" template="StandardPage" redirectUrl="/products/product/{0}" />
        <add alias="Company" template="StandardPage" redirectUrl="/companies/company/{0}" />
    </items>
</enhancedPreviewConfiguration>

Like the example above, the extension registers a config file, EnhancedPreviewConfiguration.config under /config/ directory. Based on this example, a document type Product will use the template StandardPage for its preview mode. After the preview, the preview page will be redirected to /products/product/[productId] page.

If you guys are interested in, please visit the following websites.

Advertisements

Written by Justin Yoo

31/07/2012 at 17:20

Posted in For .NET

Tagged with , ,

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s