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

  • 2 years later...

*bump*

A web site staging system is still sorely missed. All suggested solutions are no work around.

ProDraft applies to individual pages. There is no central button "RollOut" to make the new version of multiple pages go live in one go.

Besides ProDraft is sometimes quirky with repeaters.

Is there really not even a thought of implementing a staging mechanism?

 

P.S.: Just noticed that the top title is not ideal. It should be "website staging" instead of just "page staging". Sorry for that.

Link to comment
Share on other sites

This is something that I'd also wish to have. But it's not easy to do properly.

10 minutes ago, Knubbi said:

ProDraft applies to individual pages. There is no central button "RollOut" to make the new version of multiple pages go live in one go.

If that's the only thing missing have you thought of asking Ryan for adding that feature to ProDrafts?

  • Like 1
Link to comment
Share on other sites

I have never used ProDrafts, but the docs mention a drafts manager:

https://processwire.com/store/pro-drafts/#drafts-manager

Quote

From here you can review pending drafts, compare and view them, publish or abandon them, individually or in groups.

Quote

From there you can perform batch publish/abandon operations

Sounds like it's exactly what you're asking for.

spacer.png

And even if that feature wouldn't exist: It would be quite easy to use ListerPro and write a custom Batch Action I guess...

Edited by dragan
added image
  • Like 1
Link to comment
Share on other sites

1 minute ago, dragan said:

And even if that feature wouldn't exist: It would be quite easy to use ListerPro and write a custom Batch Action I guess...

I don't think so. At least not with the kind of site that I build. As soon as you have some references in your pages or media like images etc. it gets tricky I guess... But maybe it's easier than I think. I'd be happy if that's the case ? 

Link to comment
Share on other sites

2 minutes ago, bernhard said:

I don't think so. At least not with the kind of site that I build. As soon as you have some references in your pages or media like images etc. it gets tricky I guess... But maybe it's easier than I think. I'd be happy if that's the case ? 

Well, I meant if you have ProDrafts installed, but it would be missing the batch publishing feature. I know that building a staging workflow from scratch is far from easy - otherwise we'd have a dozen modules out there already and this forum thread wouldn't even exist ?

Link to comment
Share on other sites

  • 1 month later...

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...