Recently Viewed
This plugin adds functionality to the existing Element Query fluent interface allowing you to filter and order elements by whether they have been recently viewed by the user.
Just like 'recently viewed products' on Amazon.
'Views' can be automatically tracked based on URLs visited by the user and displaying is as easy as:
{% set recentBlogPosts = craft.entries.section('blogPosts').recentlyViewed().orderByDateViewed().limit(3).all() %}
The plugin will work with any element type, including Commerce products and any custom elements from other plugins.
If you don't want to auto-track views, or you'd like to track views on elements which can't be natively linked to a specific URL (such as Assets or tags) you can manually track views like so:
{% do craft.recentlyViewed.track(element) %}
Where element
can be anything that implements craft\base\ElementInterface
.
Price includes 1 year of updates.
$5/year per site for updates after that.
- Installation Instructions
To install this plugin, copy the command above to your terminal.
- Active Installs
- 174
- License
- Craft
- Last release
- May 12, 2022
- Activity (30 days)
- 0Closed Issues0Open Issues0Merged PRs0Open PRs