lastModified

22 views
Skip to first unread message

Thomas König

unread,
Apr 20, 2016, 7:54:07 AM4/20/16
to apostrophenow, thomas...@sz.de
Hello everybody,

i need to know when a blog-post was last modified. Unfortunately there is no field in the mongoDB. Is there any possibility to gather that information?

Thomas König

unread,
Apr 20, 2016, 7:59:58 AM4/20/16
to apostrophenow, thomas...@sz.de
I also thought about adding a lastModified-Field by hand following the instructions on http://apostrophenow.org/tutorials/snippets/advanced-server-side-2.html

var superBeforeSave = self.beforeSave;

self.beforeSave = function(data, snippet, callback) {
  snippet
.publicationDate = self._apos.sanitizeDate(data.publicationDate, snippet.publicationDate);
 
return superBeforeSave(data, snippet, callback);
}

Which.... doesn't work :-(

Tom Boutell

unread,
Apr 20, 2016, 11:35:41 AM4/20/16
to apostr...@googlegroups.com
The publication date is not the last time of modification.

You might look at the aposVersions collection which is aware of every content edit.

--
You received this message because you are subscribed to the Google Groups "apostrophenow" group.
To unsubscribe from this group and stop receiving emails from it, send an email to apostropheno...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--


THOMAS BOUTELL, DEV & OPS
P'UNK AVENUE | (215) 755-1330  |  punkave.com

Tom Boutell

unread,
Apr 20, 2016, 11:37:03 AM4/20/16
to apostr...@googlegroups.com
(createdAt and updatedAt are standard equipment for all docs in 0.6.)

Thomas König

unread,
Apr 21, 2016, 3:38:07 AM4/21/16
to apostrophenow, thomas...@sz.de
Hey Tom,

thanks for your response. Surely I know that publicationDate !== lastModified ;-) I updated/created the lastModfied-timestamp now by hook into beforePutOne (of apostrophe-blog-2) as well as putArea (of editor) – both server-side. Which works perfectly fine for us ;-) Glad to hear, that in version 0.6 that will be included. When do you plan to go live with 0.6?

Thanks
Thomas


Am Mittwoch, 20. April 2016 13:54:07 UTC+2 schrieb Thomas König:

Tom Boutell

unread,
Apr 21, 2016, 7:36:06 AM4/21/16
to apostr...@googlegroups.com
0.6 is already going live in the sense that we have clients doing pre-launch content population, or will very shortly... there's a README with it that explains how to get going. You can use an npm dependency pointing at the git repo rather than npm link if you wish, which is how we're using it in production for now.


Everyone has had a good laugh at this sentence:

"How to make a website with Apostrophe 0.6 unstable"

But for now that doesn't seem entirely unfair, although with us moving into production we obviously are not making bc breaks every day anymore. (:

--
You received this message because you are subscribed to the Google Groups "apostrophenow" group.
To unsubscribe from this group and stop receiving emails from it, send an email to apostropheno...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Tom Boutell

unread,
Apr 21, 2016, 7:38:06 AM4/21/16
to apostr...@googlegroups.com
That HOWTO demonstrates how to create your own blog from scratch by subclassing pieces, which is important, but it does not mention that we actually do have "unstable" branches of apostrophe-blog, apostrophe-events and apostrophe-places now. No READMEs for those yet though, and we need to cover how you register them as bundles in your project in order to make them work. Maybe Kerry can chime in with an example?

Thomas König

unread,
Apr 22, 2016, 3:29:51 AM4/22/16
to apostrophenow
Nice to hear that. »How to make a website with Apostrophe 0.6 unstable« also brought us to lough :-) For now we are happy with 0.5. But I think in the nearer future we'll update to 0.6... Is there any list of changes you've made in from 0.5 to 0.6?

Tom Boutell

unread,
Apr 22, 2016, 12:28:19 PM4/22/16
to apostr...@googlegroups.com
Well... it's a complete rewrite! Every component has been rebuilt with much more care as to how they can be extended and maintained in the future.

Concepts have remained much the same though. "Snippets" are now "pieces," and the architecture around them is vastly clearer and more maintainable, but the idea is the same.

Reply all
Reply to author
Forward
0 new messages