Advertisement
Guest User

Untitled

a guest
Jun 18th, 2019
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.85 KB | None | 0 0
  1. {#
  2. Options for getVersionsByEntryId
  3. * @param int $entryId The entry ID to search for.
  4. * @param int|null $siteId The site ID to search for.
  5. * @param int|null $1 limit The limit on the number of versions to retrieve.
  6. * @param bool $includeCurrent Whether to include the current "top" version of the entry.
  7. * @param bool $withContent Whether the field content should be included on the versions.
  8. * @return EntryVersion[]
  9. #}
  10. {% set entryId = 7 %}
  11. {% set siteld = null %}
  12. {% set limit = null %}
  13. {% set includeCurrent = true %}
  14. {% set withContent = false %}
  15. {% set versions = craft.app.entryRevisions.getVersionsByEntryId(entryId, siteId, limit, includeCurrent, withContent) ?? null %}
  16.  
  17. {% if versions|length %}
  18. <ul>
  19. {% for version in versions if version.getCreator() %}
  20. <li>{{ version.getCreator().username }}</li>
  21. {% endfor %}
  22. </ul>
  23. {% endif %}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement