Jump to content

Page draft module - useful to anyone? Please feed back!


Rob
 Share

Recommended Posts

On this cold and rainy weekend in Switzerland, I was trying to learn something about Processwire modules.
"Page Draft Control" seemed an ideal starting point, because it has not so many lines of code and looks rather abandoned. ;)
While trying to understand it, I've added some code.
For me the result looks quite usable, but I am very open for any suggestions, about what could be done better theoretically.
I'm not going to further develop this, because there is ProDrafts if you need something perfect.

Processwire modules and "ecosystem" are really great. ^-^

Thank you.

 

  Reveal hidden contents

 

pwdraft.png

  • Like 3
Link to comment
Share on other sites

  On 1/21/2018 at 4:53 PM, theo said:

While trying to understand it, I've added some code.

Expand  

Nice one!

  On 1/21/2018 at 4:53 PM, theo said:

For me the result looks quite usable, but I am very open for any suggestions, about what could be done better theoretically.

Expand  

I think the fact that the ID of the original page is not retained when the draft replaces it is a bit of a problem. Because any pages that have a reference to the original page in a Page Reference field will lose that when the draft is published and the original is trashed. This issue is discussed earlier in the thread, and Ryan's suggestion was to copy the content of the draft page to the original page when the draft is ready to go live. Maybe you could look at using that approach?

  • Like 2
Link to comment
Share on other sites

  On 1/22/2018 at 12:07 AM, Robin S said:

I think the fact that the ID of the original page is not retained when the draft replaces it is a bit of a problem. Because any pages that have a reference to the original page in a Page Reference field will lose that when the draft is published and the original is trashed. 

Expand  

Yes, it is true. But this will get too complicated. It's just an exercise for me.

Take ProDrafts if you need to cross reference elements by id.

It will work in simpler scenarios it think. It is up to the "admin" to decide.

At least the original page will remain untouched this way. You can even restore it from trash as if nothing happened.

Thank you.

  • Like 1
Link to comment
Share on other sites

To tell the truth I have not yet used @Robin S's ConnectPageFields module, but maybe he could come up with a solution based on the inner workings of his module to take further this Page Draft module. I'm just wild guessing here and probably daydreaming :) however, it would be great to see a free alternative to ProDrafts as a draft feature would be welcome, but I do not have a project which needs all the extra features of ProDrafts, I could do with  just draft+published states for the "body" field, keeping the already published state intact until it is overwritten with the draft version which can be saved too, independent of the published one.

 

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