ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

Weblog Entry Preview

September 11, 2007 8:20am

Subscribe [6]
  • #1 / Sep 11, 2007 8:20am

    kingdoz

    45 posts

    When adding/editing a weblog entry it shows a text based preview of the output, how can I show a preview in the context of the actual site?

  • #2 / Sep 12, 2007 7:28am

    kingdoz

    45 posts

    anyone?

  • #3 / Sep 12, 2007 8:53am

    Stephen Slater

    366 posts

    Do you have your templates setup to pull in the weblog data?

  • #4 / Sep 12, 2007 9:17am

    kingdoz

    45 posts

    yes, we have templates for the design which outputs the weblogs

  • #5 / Sep 12, 2007 9:24am

    Stephen Slater

    366 posts

    To preview the weblog data in the form of the actual site, you’d preview the templates.  It’s the templates plus the weblog data that actually make up the site.

  • #6 / Sep 12, 2007 9:29am

    Stephen Slater

    366 posts

    After reviewing your question a second time and visiting the control panel to take a look, I see your desire.  I don’t know of a way to preview the entry after submitting it.  The only way I know would be to navigate to the entry after viewing the template and/or site.

  • #7 / Sep 12, 2007 9:44am

    kingdoz

    45 posts

    the main issue is that they want to see what the site will look like before publishing it

  • #8 / Sep 12, 2007 9:52am

    Stephen Slater

    366 posts

    Off the top of my head, you could…

    - set the entry date into the future
    - set the template for the live site to not show future entries
    - setup a template for previewing with a parameter set to show future entries
    - preview the template for previews
    - once everything looks good, set the date of the entry to the present

    Man, as I type this, it seems like there has to be a better way.  Maybe I’m not thinking clearly at the moment, but that’s all I can think of.

  • #9 / Sep 12, 2007 10:05am

    cshort

    59 posts

    I’d say a better option would be to add a custom field for a status on whether it’s published or not.  Have an extra template like Stephen lists that shows even the unpublished entries for preview purposes. 

    Short of rewriting the code that generates the preview in cp.publish.php I don’t see a better way at the moment.

  • #10 / Sep 12, 2007 10:09am

    kingdoz

    45 posts

    its a bit of a pain considering the number of templates and weblogs we have to recreate the entire site (and edit two sites if we want to change one thing)

  • #11 / Sep 12, 2007 10:15am

    Stephen Slater

    366 posts

    Yeah, I could see that being a pain.  Before I’d recreate the site for previews, I’d set up a duplicate testing (dev) site.  This would allow you to get things looking like you want before pushing the changes to the production (live) server.

  • #12 / Sep 12, 2007 10:24am

    cshort

    59 posts

    After looking a little further, there is an extension hook called publish_form_preview_additions that could possibly be used to create an appropriate preview.

  • #13 / Sep 12, 2007 10:27am

    kingdoz

    45 posts

    Yeah, I could see that being a pain.  Before I’d recreate the site for previews, I’d set up a duplicate testing (dev) site.  This would allow you to get things looking like you want before pushing the changes to the production (live) server.

    this would make it even more time consuming to update any design/functionality changes (thanks for the suggestions tho- we’ll find the right solution i’m sure 😊)

  • #14 / Sep 12, 2007 10:42am

    kingdoz

    45 posts

    After looking a little further, there is an extension hook called publish_form_preview_additions that could possibly be used to create an appropriate preview.

    http://ee.koruproductions.com/live_link/

    the instructions are a bit confusing…. what exactly does this mean? (any examples?)

    // template group and names with the weblog_id appended to
            // create separate options for each weblog
            //
            // Follow this pattern for each weblog, replacing the # with
            // the id of the weblog:
            // 
            // $settings['tmpl_group_#'] = 'template_group';
            // $settings['tmpl_name_#'] = 'template_name';
    // Just as with the $settings array in ext.live_link.php
    // you must have a pair of keys and values so your
    // settings will be labeled properly.
    //
    // Follow this format, replacing # with the id of
    // the weblog:
    //
    // "tmpl_group_#" =>
    // "Name of Template Group",
    //
    // "tmpl_name_#" =>
    // "Name of Template",
  • #15 / Sep 12, 2007 11:13am

    cshort

    59 posts

    I missed that extension entirely… Glad to know it’s there.

    What it’s asking you to do is replace the # character with the numeric id of the weblog and then give the associated template group and the primary template name that’s to be used for the preview.

    So, say you’re wanting to do it with EE’s standard weblog template.

    $settings['tmpl_group_1'] = 'site';
    $settings['tmpl_name_1'] = 'comments';

    This would associate that template group and name with every entry in that weblog for preview purposes.  For each additional weblog, you add two more lines changing the number and the template info.

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases