<p>Craft doesn't have anything like an <a href="http://buildwithcraft.com/docs/plugins/events-reference" rel="nofollow">onViewEntry</a> event, which you could listen for.</p>

<p>One way to do it would be to have a plugin that listens for <code>onEndRequest</code>. That plugin would determine if the current URI matches an entry and if so saves it to the database along with the userId.</p>

<p>Then you could build a management page off of that info where you could remove from the history or delete it all-together.</p>

CC BY-SA 3.0
2015-02-18T10:15:30.570Z
just as a side note: an onViewEntry with access to the $context e.t.c would be super awesome for a future version :) This would help a lot with moving some of the logic currently done in templates to a controller
Sidney Widmer
CC BY-SA 3.0
2015-02-17T20:29:55.983Z
2015-02-17T20:29:55.983Z
Brad Bell
<p>What approach should I take to create a list of previously viewed entries? Including the ability display the list, remove an entry from the list or delete the whole list.</p>

<p>The previously viewed entries list would only exist for the duration of a visit.</p>

CC BY-SA 3.0
2015-02-18T07:01:25.023Z
Maybe this plugin does what you're after: https://www.putyourlightson.net/craft-cms-plugins#counter
carlcs
<entries>
How can I list previously viewed entries?
# How can I list previously viewed entries?

(Asked by: username_0 on 2015-02-17)

What approach should I take to create a list of previously viewed entries? Including the ability display the list, remove an entry from the list or delete the whole list.

The previously viewed entries list would only exist for the duration of a visit.

**Tags:** entries

> **Comments:**
> **username_1**: Maybe this plugin does what you're after: https://www.putyourlightson.net/craft-cms-plugins#counter  

---

## 1 answers

### Answer by username_2 on 2015-02-17. Score: 1 | Accepted answer

Craft doesn't have anything like an [onViewEntry](http://buildwithcraft.com/docs/plugins/events-reference) event, which you could listen for.

One way to do it would be to have a plugin that listens for `onEndRequest`. That plugin would determine if the current URI matches an entry and if so saves it to the database along with the userId.

Then you could build a management page off of that info where you could remove from the history or delete it all-together.

> **Comments:**
> **username_3**: just as a side note: an onViewEntry with access to the $context e.t.c would be super awesome for a future version :) This would help a lot with moving some of the logic currently done in templates to a controller  

---

