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.

How to include draft entries for logged in Admins?

September 30, 2011 6:27am

Subscribe [3]
  • #1 / Sep 30, 2011 6:27am

    nathanpitman

    531 posts

    I’ve hit a road block on this one… I’m trying to set a site up such that a logged in admin can see entries with a status of “Draft” on the front end and preview them in context before marking them as “Open”. I had assumed I could just chuck a conditional block into the channel:entries tag as follows:

    {exp:channel:entries channel="products" status="{if member_group=='1|6'}|draft{/if}"}

    However this doesn’t work, I’ve also tried using the preload_replace variable type but it appears this cant be wrapped in a conditional as it’s parsed before other EE tags. Any ideas..? I’d really rather not have to enable PHP for such a small task…

  • #2 / Sep 30, 2011 6:55am

    only thing I can think of is to place the code in an embed, then pass it the status through an embed variable?

    {embed="template/.inc_entries_include" status="{if member_group=='1|6'}draft{/if}"}
  • #3 / Sep 30, 2011 6:58am

    nathanpitman

    531 posts

    ah yes, that would probably work! Thanks! 😊

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

ExpressionEngine News!

#eecms, #events, #releases