Jump to content

Recommended Posts

Posted

Okay, so I think I know how to do this, but I can't quite get my head around it.

When I publish an article on a site I am nailing together, it appears in various listings around the site - homepage, list of recipes, whatever.

While it is unpublished, I want to be able to preview it in its various guises, not just the main article.

I think it should be something like if logged in user=author, erm, also display unpublished articles by this author, or something.

Though, of course, that might bring up a lot of rubbish too - all those unpublished articles I haven't got around to finishing.

I suppose I could add a "preview" checkbox so that it will only display the various bits from an unpublished article if this checkbox is also selected.

if logged in user=author, also display unpublished articles by this  author where preview=1, or something else?

Is this making any sort of sense to anyone?

Diogo? Are you out there? You are normally good with my ramblings!

Posted

Are we talking about an 'in-context' preview or something slightly else? In other words, if author is logged in and preview=1, show appropriate unpublished items as if they were published to world+dog? Seems a very reasonable thing to do.

When I first read the OP, I wondered if you were talking about some kind of 'preview' template, just to show the different ways an article might appear across the site, but in-context is probably better.

You'll just need to check if one or more unpublished items should be included in the page and adjust any content selectors appropriately, obviously depending on whatever output strategy is in use. It might also be helpful, either in an admin module or an extra bit injected into the site output to list the urls where the content in question can be seen, to help the preview process.

 

Posted

hmm... maybe you could hook page::viewable? something like

hookafter page::viewable
if($page->isUnpublished() AND $page->previewcheckbox == 1 AND $page->createdUser == $user) $event->return = true;

i would also create a hook to remove the preview checkbox for all pages that were edited more than 1 hour ago (or 1 day)

Posted

Dave - yep, in context. That was the phrase I was looking for!

 

Bernhard - that might do it. I rather like that idea of removing checkbox values. Could save clutter.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...