Forum

Thread tagged as: Question

Draft preview on list and detail pages

Hi,

Is it possible to setup "save as draft" and previews (similar to blog articles) when generating list and detail pages (regular Perch)?

Is this better suited to pages/subpages setup?

Mark Heggan

Mark Heggan 1 points

  • 6 years ago
Drew McLellan

Drew McLellan 2638 points
Perch Support

Yes, you can do that. Make sure you've set the detail page path in the region options.

Thanks Drew, that's good to hear! However, I'm having some trouble getting previews/drafts working the way I'd expected.

I've currently got a list/detail set up within a subfolder "app-help'

Within "app-help" I have two pages ("index.php" for the list and "page.php" for the detail).

Here's the code I'm using to create the page/region

perch_content_create('Help Pages', array(
    'template'=>'app-help/post.html',
    'multiple'=>true,
    'edit-mode'=>'listdetail',
    'search-url'=>'/app-help/page.php?s={slug}'
));

The List mode:

perch_content_custom('Help Pages', array(
    'template'=>'app-help/post_in_list.html',
));

And the Detail mode:

perch_content_custom('Help Pages', array(
    'page'=>'/app-help/index.php',
    'template'=>'app-help/post.html',
    'filter'=>'slug',
    'match'=>'eq',
    'value'=>perch_get('s'),
    'count'=>1,
));

The problem I'm having is that when I choose "save as draft" on any item within the region, the whole region and all items within turn to drafts?

This happened when I manually set the detail page path in the region options (first attempt), and it also happens with the detail page path being set by perch_content_create. Any idea where i'm going wrong?

Thanks

Drew McLellan

Drew McLellan 2638 points
Perch Support

With content regions the draft is a revision of the entire region. If you need per-item revisions that comes with Collections in Runway,

Thanks Drew, it's coming!