Jump to content

Page Staging


Knubbi
 Share

Recommended Posts

We use the amazingly awesome Processwire as a website CMS. Again, thanks to Ryan and the Community to make it happen!

What we miss is a a staging mechanism:

The "production version" of a page is visible for the public.

A different "work in progress" version of the same page is only visible for specific users (or user groups).

Specific users can turn "work in progress" pages into "production version".

Does this exist already? Is there a workaround to achieve it or would this be something 4.0?

Link to comment
Share on other sites

You could use site/config .php settings, eg:

<?php

if ($user->hasRole('dev') { // or whatever role you assign 
// development templates directory
$config->urls->templates = $config->urls->site . 'templates-dev/';
$config->paths->templates = $config->paths->site . 'templates-dev/';

$config->urls->fieldTemplates = $config->urls->templates . 'fields/';
$config->paths->fieldTemplates = $config->paths->templates . 'fields/';

} 

// other users, including the public, will see the default $config->templates & $config->paths (same for fields) 

 

  • Like 1
  • Thanks 1
Link to comment
Share on other sites

@psy No idea, I haven't used ProDrafts yet. Though unless I have misunderstood the question, this question is about having public and draft versions of a page's content, not different versions of it's PHP template. So I don't think your suggestion applies to this use-case?

  • Like 1
Link to comment
Share on other sites

We do have "version control" but it doesn't hide the latest (work in progress) version. It's kind the other way round.

P.S.: Just found, that we do have a ProDrafts license. Any insight, when this might be included in ProDrafts (Quote of description "In addition, fields using a type of Repeater or PageTable are not currently supported for drafts (though support is planned).")?

 

 

  • Like 1
Link to comment
Share on other sites

This may seem like a hackish workflow proposal, but you could just as well clone the production page, unpublish that copy, and work on that. If the clone is ready to be published, publish that one and hide / unpublish the other. Just bear in mind to adjust the page names and -names to avoid ugly looking URLs like /section/my-page-name-copy and 404s.

  • Like 1
Link to comment
Share on other sites

ProDrafts is working good with repeaters. In rare occasions there are some quirks, but you could customize your ProDrafts settings in that case.

Another solution would be to have a staging website and a production website, which I would recommend in any case. The client could prepare new pages on the staging website and you could export and import them to the production website with the import/export feature. For small changes that would be overkill, but for large changes to the website this is also a good way.

Regards, Andreas

  • Like 2
Link to comment
Share on other sites

I actually was working on something similar to import/exporting using the Rest API module here at work. I have a cron job set up targeting a specific page (on the live site) with some jquery checking the api endpoint (local dev server with an external locked ip). I then post that to the targeted page and run some php to update fields on the live site with the content.. It's overkill, but I like it as it allows new content/changes to be uploaded if in case I wasnt able to get to it.

  • Like 1
Link to comment
Share on other sites

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
 Share

  • Recently Browsing   0 members

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