1

For a news site I would like to retrieve the number of times an entry has been updated since postDate. Is that possible without using a plugin? Im using craft pro and have versioning enabled for that section.

1

Update: This came up in another question and I think that I may have found a simple way to do this without the use of a plugin.

{% set versions = craft.entryRevisions.getVersionsByEntryId(entry.id, entry.locale) %}
{{ versions|length }}
| improve this answer | |
  • Thank you Douglas, but im not very familiar with plugin development yet. Maybe this will turn up in the feature releases of craft. Thanks for your time. – imnotsure Jan 3 '15 at 11:52
  • @imnotsure have a go at installing the businesslogic plugin. Then just paste the above code into the variables file. It's really very easy. And I think that you'll soon find that every project requires at least some small business logic that is best served with a small plugin. And if you have a questions, we'll be glad to help. – Douglas McDonald Jan 4 '15 at 19:26
  • Ill give it a try. Thanks for the code example! – imnotsure Jan 10 '15 at 12:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.