Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- {#
- Options for getVersionsByEntryId
- * @param int $entryId The entry ID to search for.
- * @param int|null $siteId The site ID to search for.
- * @param int|null $1 limit The limit on the number of versions to retrieve.
- * @param bool $includeCurrent Whether to include the current "top" version of the entry.
- * @param bool $withContent Whether the field content should be included on the versions.
- * @return EntryVersion[]
- #}
- {% set entryId = 7 %}
- {% set siteld = null %}
- {% set limit = null %}
- {% set includeCurrent = true %}
- {% set withContent = false %}
- {% set versions = craft.app.entryRevisions.getVersionsByEntryId(entryId, siteId, limit, includeCurrent, withContent) ?? null %}
- {% if versions|length %}
- <ul>
- {% for version in versions if version.getCreator() %}
- <li>{{ version.getCreator().username }}</li>
- {% endfor %}
- </ul>
- {% endif %}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement