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]
  • #16 / Sep 12, 2007 11:33am

    kingdoz

    45 posts

    thanks

    after trying this out its not quite what i’m looking for

    is there a way to have a “view preview site” link which will load the the normal website but append a variable to all pages (e.g ?preview=true). I can then do if statements to check the status and show the correct content.

    I could then create a custom script to publish the site (simply goes through all the entries and changes the status from preview to live for e.g.

  • #17 / Sep 12, 2007 6:58pm

    Stephen Slater

    366 posts

    What about making the Status IF statement and only show the contents to a specific member group?  That member group being content publishers and then switching the status to make it go live.

    Make any sense?

  • #18 / Sep 12, 2007 7:00pm

    Stephen Slater

    366 posts

    {if member_group == '3'}
    {exp:weblog:entries  weblog="news"  status="draft" }
    content
    {/exp:weblog:entries}
    {/if}
  • #19 / Sep 12, 2007 8:14pm

    cshort

    59 posts

    You might try using the Quick links at the top of the control panel for that.  Otherwise you would have to modify the core php to add that link to the edit page.

  • #20 / Sep 13, 2007 4:40pm

    JCI

    144 posts

    {if member_group == '3'}
    {exp:weblog:entries weblog="news" status="draft" }
    content
    {/exp:weblog:entries}
    {/if}

    I tried this.. along with several other variations, and could never get it to act right. See my neglected post here

    I thought that was the whole point of group statuses? To give specific user groups different views. For example.. letting an Editor view all the entries marked with a ‘Proofing’ status, but not letting anyone else see those until they’re changed to an ‘Open’ status.

    Am I missing something??

  • #21 / Sep 13, 2007 4:55pm

    cshort

    59 posts

    I wouldn’t say it’s neglected, it’s not even 4 hours old by my watch.  I left a comment over in that thread.

  • #22 / Sep 14, 2007 7:15am

    kingdoz

    45 posts

    -edit- not perfect solution yet 😉

  • #23 / Sep 14, 2007 7:25am

    kingdoz

    45 posts

    what happens to pages which only show a single entry? We’d still need to show the “old” version to visitors while the new version is being checked. If we set it to draft, then nothing would show if we did it based on member groups

  • #24 / Sep 17, 2007 6:23am

    kingdoz

    45 posts

    bump

  • #25 / Sep 17, 2007 7:50am

    George Ornbo

    272 posts

    Here’s how I set up my workflow.
    First I define member groups and note down id number of member groups I want to be able to see previews of entries.

    Second I add a custom status of “Pending” to the default “Open” and Closed”.

    Then I use this code to check whether the user is logged in and what group they are in. The appropriate content is served to the user based on their group and whether I want them to be able to see Pending articles. Here’s the code:

    {!-- For logged in users with permission to view preview --}
    {if logged_in && (group_id == '1' OR group_id == '2')}
        {exp:weblog:entries weblog="{your_weblog}" status="Open|Pending"}
            ...Your output for logged in users with permission to see Pending here…
            ...Show Open and Pending articles…
        {/exp:weblog:entries}
    {!-- For logged in users with no permission to view preview --}
    {if:elseif logged_in && group_id == '3'}
        {exp:weblog:entries weblog="{your_weblog}" status="Open"}
            ...Your output for logged-in users without permission here…
            ...Show only Open articles…
        {/exp:weblog:entries}
    {!-- For non-logged in users --}
    {if:else}
        {exp:weblog:entries weblog="{your_weblog}" status="Open"}
            ...Your output for non-logged in users here…
            ...Show only Open articles…
        {/exp:weblog:entries}
    {/if}
  • #26 / Sep 17, 2007 8:04am

    kingdoz

    45 posts

    thanks for the reply, but this doesnt solve the issue that we would need two versions of the entry - one for the preview (unpublished) site which can be reviewed, and one for the live site.

    The whole point of a preview feature is to see what the site will look like before publishing. Once happy with the new content, the admin would then set it to live and the general public would see it. Before this, they would see the “old” content

  • #27 / Sep 17, 2007 8:18am

    George Ornbo

    272 posts

    If you are looking for a preview for new content added by editors then the code above will work fine.

    If you are looking for a preview of existing content that is amended by editors then there is no support for this in EE currently. You’d be best to add it as a feature request.

    See this thread where I was (I think!) looking for the same thing.

  • #28 / Sep 17, 2007 8:30am

    kingdoz

    45 posts

    Yup - it looks like I have the same issue as you

    Unfortunately, we need this feature yesterday - we need ideas and possible methods so that it can be implemented (and we will foot the bill of getting it implemented)

  • #29 / Sep 17, 2007 8:33am

    kingdoz

    45 posts

    i suppose the basic workflow required is:

    1) content created/edited 2) content reviewd (in “working” site) and then approved 3) content published

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

ExpressionEngine News!

#eecms, #events, #releases