Answers.Body: <p>Something like this might work.</p>
  
  <pre><code>{% if not craft.request.isAjax %}
  
      {% set versions = craft.entryRevisions.getVersionsByEntryId(entry.id, entry.locale) %}
  
      Versions: 
      &lt;select class="js-versions-dropdown"&gt;
          &lt;option value=""&gt;Current&lt;/option&gt;
          {% for versionEntry in versions %}
              &lt;option value="{{ versionEntry.versionId }}"&gt;Version {{ loop.index }} ({{ versionEntry.postDate|date('m-d-Y') }} )&lt;/option&gt;
          {% endfor %}
      &lt;/select&gt;
  
  {% endif %}
  
  {% if craft.request.isAjax %}
  
      {% if craft.request.param('versionid') %}
          {% set entry = craft.entryRevisions.getVersionById(craft.request.param('versionid')) %}
      {% endif %}
  
  {% endif %}
  
  &lt;div&gt;
      {{ entry.title }}
      ...
  &lt;/div&gt;
  </code></pre>
  
  <p>In this example, you would want to listen for an <code>onChange</code> event on the dropdown list and reload the template via ajax, passing the 'versionid' as a post variable. Alternatively you could also just reload the whole page, in which case remove the 'if ajax' stuff. In this case, you'll probably also need to add some logic to the drop-down list so as to display the correct 'selected' option in the list.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-04-06T18:07:04.963Z
Answers.Text: This is perfect. Thank you! Is there any way to just list each versions contents without ajax? I tried using `{{versionEntry.fieldName}}` in the for loop but it just output the same value as the current version even though the field has different values for different versions.
Answers.UserDisplayName: ntoombs19
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-04-07T00:27:25.377Z
Answers.Text: Should work fine without ajax — as a test I was able to use {{ versionEntry.title }} in the for loop and display the different version titles just fine. Not sure why your not seeing the different content — you might double check the saved version content.
Answers.UserDisplayName: Douglas McDonald
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-04-06T17:08:14.827Z
Answers.LastActivityDate: 2015-04-06T17:35:33.750Z
Answers.LastEditDate: 2015-04-06T17:35:33.750Z
Answers.UserDisplayName: Douglas McDonald
Body: <p>When editing an entry from the control panel you can switch versions of the entry. I would like to do the same thing but on the front end. Is there any way to do this using native craft functionality or do I need to use a plugin.</p>
  
Tags: <plugins>
Title: How can I display entry edit history on the front end?
ThreadText: # How can I display entry edit history on the front end?
  
  (Asked by: username_0 on 2015-04-06)
  
  When editing an entry from the control panel you can switch versions of the entry. I would like to do the same thing but on the front end. Is there any way to do this using native craft functionality or do I need to use a plugin.
  
  **Tags:** plugins
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2015-04-06. Score: 2 | Accepted answer
  
  Something like this might work.
  
  ```
  {% if not craft.request.isAjax %}
  
      {% set versions = craft.entryRevisions.getVersionsByEntryId(entry.id, entry.locale) %}
  
      Versions: 
      <select class="js-versions-dropdown">
          <option value="">Current</option>
          {% for versionEntry in versions %}
              <option value="{{ versionEntry.versionId }}">Version {{ loop.index }} ({{ versionEntry.postDate|date('m-d-Y') }} )</option>
          {% endfor %}
      </select>
  
  {% endif %}
  
  {% if craft.request.isAjax %}
  
      {% if craft.request.param('versionid') %}
          {% set entry = craft.entryRevisions.getVersionById(craft.request.param('versionid')) %}
      {% endif %}
  
  {% endif %}
  
  <div>
      {{ entry.title }}
      ...
  </div>
  
  ```
  
  In this example, you would want to listen for an `onChange` event on the dropdown list and reload the template via ajax, passing the 'versionid' as a post variable. Alternatively you could also just reload the whole page, in which case remove the 'if ajax' stuff. In this case, you'll probably also need to add some logic to the drop-down list so as to display the correct 'selected' option in the list.
  
  > **Comments:**
  > **username_0**: This is perfect. Thank you! Is there any way to just list each versions contents without ajax? I tried using `{{versionEntry.fieldName}}` in the for loop but it just output the same value as the current version even though the field has different values for different versions.  
  > **username_1**: Should work fine without ajax — as a test I was able to use {{ versionEntry.title }} in the for loop and display the different version titles just fine. Not sure why your not seeing the different content — you might double check the saved version content.  
  
  ---
  
  