We are using getVersionsByEntryId
in our XML sitemap to return the number of times an entry has been saved, then comparing that with todays date and the date the entry was created to determine the changefreq
over that time:
{% set revisions = craft.app.entryRevisions.getVersionsByEntryId(element.id)|default(1)|length %}
Looking at the docs however, this is now deprecated:
DEPRECATED
Deprecated in 3.2. Use an entry query instead.
I can't seem to find anything in the docs for an entry query? Could someone point me in the right direction?
{% set revisions = craft.entries.revisionOf(element.id).all|default(1) %}
. Please post that as an answer and I'll accept :-) – Jamie Wade Oct 24 '19 at 14:32