# Page Versioning

**URL:** <https://www.ruby-forum.com/t/page-versioning/114659>\
**Category:** Radiant CMS\
**Created:** [September 17, 2007, 1:23pm UTC](https://www.ruby-forum.com/t/page-versioning/114659 "2007-09-17T13:23:46Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![mohits](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/bbe5ce/32.png) [@mohits](https://www.ruby-forum.com/u/mohits)\
**Post date:** [September 17, 2007, 1:23pm UTC](https://www.ruby-forum.com/t/page-versioning/114659/1 "2007-09-17T13:23:46Z")

</div>

Hi Everyone,

As I understand it, Radiant doesn’t seem to support page versions and  
comments for the page versionsdirectly… is there any extension that  
does? It seems that it should be easy enough to have support for  
comments about the different page versions. That would allow me to add  
something like:

RECENT CHANGES  
Version 8: Sep 12, 2007 - Added detailed explanation for Installation.  
Version 7: Sep 10, 2007 - Minor changes; corrected punctuation errors.  
Version 6: Sep 2, 2007 - Global revision change.  
[Click here for earlier changes]

The comments can be done by adding a ‘has\_many CommentsAbtversions’ to  
the Page and then adding a small text input that allows the comment to  
be input.

Q1: In an extension, how do I tell the difference between a ‘Save’ and  
‘Save & Continue Editing’ - I thought it may be better to save comments  
only when one does a ‘Save’ as against when he does a ‘Save & Continue  
Editing’.

But I’m a bit more hesitant about how to actually add in the versions  
themselves without changing the page rendering system too much.

Cheers,  
Mohit.  
9/16/2007 | 6:46 PM.

---

<div class="post-metadata">

**Author:** ![mohits](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/bbe5ce/32.png) [@mohits](https://www.ruby-forum.com/u/mohits)\
**Post date:** [September 20, 2007, 8:23pm UTC](https://www.ruby-forum.com/t/page-versioning/114659/2 "2007-09-20T20:23:18Z")

</div>

Anyone?

Thanks,  
Mohit.

---

<div class="post-metadata">

**Author:** ![mohits](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/bbe5ce/32.png) [@mohits](https://www.ruby-forum.com/u/mohits)\
**Post date:** [September 20, 2007, 9:26pm UTC](https://www.ruby-forum.com/t/page-versioning/114659/3 "2007-09-20T21:26:29Z")

</div>

I asked this back in May. Here’s the link to Sean’s response:

[http://lists.radiantcms.org/pipermail/radiant/2007-May/005038.html](http://lists.radiantcms.org/pipermail/radiant/2007-May/005038.html)

I’m wondering with facets maturing if this is more feasible now than  
it was then?

The problem I still see is more of a conceptual one: what I (and I  
think you) want is a history of changes at the Page level. However,  
changes are done at the PagePart level. But keeping a version history  
for each page part separately wouldn’t make sense to the end user, and  
it probably wouldn’t help admins either.

Also, version control is a solved problem (or at least one with a lot  
of good work already put in), whereas versioning inside of a  
relational database is a little tougher and solutions tend to be more  
one-off (at least in my experience).

Alternatively, something I’ve been toying with (and I’d love to get  
feedback) would be to use a variation of the import/export extension  
to serialize the page tree (or a subtree of it) and then put that tree  
in version control. I was thinking of creating directories for pages  
and representing each part as a file within that directory (instead of  
the single file format that Import/Export does, so that changesets  
will be more meaningful). Reverting would be a matter of loading a  
previous revision into the database (or you could keep other revisions  
in separate databases).

Some pros would be:

1. We don’t have to make structural changes to pages or page\_parts
2. We don’t have to reinvent the wheel
3. We can use proven tools that already work with repositories, such as  
a) Capistrano for deploying from an internal staging server to a  
production one,  
b) Meld (or any other diff tool) for viewing diffs

Cons:

1. If you actually want the revision data to be viewable, that might  
take a little bit of work to get it from the version control system to  
Radiant (I think it’s possible though)
2. Database reload time when moving to different revisions will  
probably be high. There would probably be an easy way to only load  
changed pages based on the changeset, which would cut down on this, at  
least for moving forward in the history.

Any comments?

-Andrew

---

<div class="post-metadata">

**Author:** ![mohits](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/bbe5ce/32.png) [@mohits](https://www.ruby-forum.com/u/mohits)\
**Post date:** [September 30, 2007, 7:10pm UTC](https://www.ruby-forum.com/t/page-versioning/114659/4 "2007-09-30T19:10:03Z")

</div>

Regarding editing the layouts and copies etc… in your browser, if  
any of you guys are on OS X and use TextMate, you can hit CTRL-CMD-E  
and the text area will open up in TextMate. You can then make your  
edits and hit CMD-S and boom, it saves it back to your browser  
window. Pretty slick. I think you need Safari 3 (WebKit and the new  
OmniWeb nightlies work too) for this…

Now, this is no substitute for a real remote editor but if you all  
hold on just a bit longer, it is possible something like a RPC blog  
editor could show up as an extension…

Cheers,

–  
Travis B.  
removed\_email\_address@domain.invalid

---

<div class="post-metadata">

**Author:** ![mohits](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/bbe5ce/32.png) [@mohits](https://www.ruby-forum.com/u/mohits)\
**Post date:** [October 1, 2007, 4:55pm UTC](https://www.ruby-forum.com/t/page-versioning/114659/5 "2007-10-01T16:55:25Z")

</div>

You know, I just had another idea. Instead of constantly  
import/exporting, if the database could be represented as a filesystem  
live, synchronization problems would disappear. For this I was  
originally thinking of FUSE (and MacFUSE), as \_why demonstrated here:

[http://tinyurl.com/dm6zr](http://tinyurl.com/dm6zr)

Unfortunately, this leaves out our Windows friends and anyone who  
doesn’t quite trust the maturity of the project yet.

Then it hit me: WebDAV. Finder supports it, and I think a number of  
the other OS’s support it in their file viewers. Overall, it’s much  
more simple to deploy. There’s even a Rails plugin for it:

[http://svn.liverail.net/svn/plugins/railsdav/](http://svn.liverail.net/svn/plugins/railsdav/)

Well, my curiosity is piqued. Hopefully I’ll get some time to play  
around with this.

-Andrew

---

<div class="post-metadata">

**Author:** ![mohits](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/bbe5ce/32.png) [@mohits](https://www.ruby-forum.com/u/mohits)\
**Post date:** [September 30, 2007, 6:33pm UTC](https://www.ruby-forum.com/t/page-versioning/114659/6 "2007-09-30T18:33:12Z")

</div>

I do like your idea. I have been thinking on something similar in  
the past. My idea was more general, like writing a backend to sqlite3  
so DB tables and rows are written directly to individual files, and  
organized in directories as you comment. This idea is too ambitious,  
and i don’t think that i will find the time and motivation to work on  
it. Your view of the problem is more simple and focused on Radiant.

I don’t like editing templates on the Radiant admin interface, it’s  
so cumbersome. Thanks to  
[https://addons.mozilla.org/en-US/firefox/addon/4125](https://addons.mozilla.org/en-US/firefox/addon/4125) it now more  
manageable for me.

```
The versioning is also painful since all the stuff is in the DB.

```

Now i use sqlite3 as much as i can, mainly because all the DB is in a  
single file and i can store it in the repository too. I do diffs on  
dumps of the DB. Not perfect but practical.

```
/AITOR

```

---

<div class="post-metadata">

**Author:** ![mohits](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/bbe5ce/32.png) [@mohits](https://www.ruby-forum.com/u/mohits)\
**Post date:** [October 1, 2007, 10:23pm UTC](https://www.ruby-forum.com/t/page-versioning/114659/7 "2007-10-01T22:23:16Z")

</div>

Having all the data mapped into the file system would be great.  
Keep us informed if you decide to dive into this.

```
/AITOR
```
