Lasting Impressions

ExpressionEngine Add-On

Easily Create a "Recently Viewed" List

Lasting Impressions Pro records the Entries that were viewed by each visitor to your website and enables you to re-display these entries  to them.

Possible uses for this add-on could be to create a "recently viewed" list for products on an e-commerce site or anywhere else that it would be useful for your site's visitors to see their viewing history.

Lasting Impressions comes with the following features:

Lasting Impressions Pro is available to purchase from the EE Add-on Store

Installation

Lasting Impressions requires ExpressionEngine version 7 and PHP 8.3+

Install from the zip archive:

  1. Copy the the "lasting_impressions_pro" folder to "system/user/addons".
  2. Copy the "/themes/lasting_impressions_pro" folder to your "/themes/user" folder.

Upgrading from Previous Versions

We strongly advise that you backup your database before upgrading.

This version is a complete re-write of Lasting Impressions which takes advantage of all the new add-on features provided by EE version 7.

The old version of Lasting Impressions should be uninstalled first. If you have entry data that you want to keep, back it up first by generating a CSV file from the CP.

IMPORTANT: Check out the "readme" file, included with Lasting Impressions, for advanced upgrade notes and breaking changes.

Tags

Register: Record Visited Entries

To start using Lasting Impressions, you use the register tag to record entries that the user has visited.

{exp:lasting_impressions_pro:register entry_id="{entry_id}" make_revisits_most_recent="yes|no" enable_reporting="yes|no"} 

entry_id

The entry_id you want to record.

make_revisits_most_recent="yes|no"

Optional: if a user visits an entry more than once, should it be moved to the top of the list?

enable_reporting="yes|no"

Optional. Defaults to "no". If set to "yes" then an entry is made for every visit in the Lasting Impressions data table. This enables you to report on visits and also enables you to use the most_popular tag to display the most popular entries for all users. Warning: the data table could fill up quite quickly when you use this parameter. You can use the "purge" utility to clear down the data.

Entries: Display the "Recently Viewed" List

The entries tag pair displays the recently visited entries to the user.

This tag behaves like the channel entries tag, so you can use the same parameters and variables as you would use with the channel entries tag except entry_id, fixed_order and dynamic.

The Lasting Impressions entries tag has two additional parameters: display_order and enable_remove.

If lasting Impressions is recording entries from different channels you'll need to cater for any different custom fields.

{exp:lasting_impressions_pro:entries display_order="register" enable_remove="no"}
{if no_results}
No Results
{/if}
{entry_id}
{title}
...other custom fields ... 
{if channel == 'blog'} ... blog specific fields ...{/if} 
{/exp:lasting_impressions_pro:entries}

display_order="register|recent|oldest"

enable_remove="yes|no"

Allow Users to Remove Entries

There are two methods you can use to enable users to remove items from their recently viewed list.

Method 1: Use Lasting Impressions' built-in removal feature.

In the entries tag, above, set the parameter enable_remove="yes" then add the following data attributes to your template:

In the code, below, when a user clicks the remove button, the entry will be deleted from their list.

{exp:lasting_impressions_pro:entries display_order="register" enable_remove="yes"}
<div data-li-container="{entry_id}">
<p>{entry_id}</p>
<p>{title}</p>
...other custom fields ...
<button data-li-remove="{entry_id}">Remove</button>
</div>          
{/exp:lasting_impressions_pro:entries}

Method 2: Roll your own.

You can implement your own removal method in any way you like but you must also call the Lasting Impressions Action to delete the entry from their list.

You'll need to get the Lasting Impressions Action Id from the exp_actions table and use the following call:

https://yourdomain.com/?ACT=[action_id]&entry_id=[entry_id_to_remove]

Display Data for a Single Entry

Use the entry_data tag to display the number of view and last viewed date/time for an Entry.

{exp:lasting_impressions_pro:entry_data entry_id="{entry_id}"}
<p>Views: {view_count}</p>
<p>Last View: {last_view format="%F %d %Y - %g:%i:%s"}</p>
{/exp:lasting_impressions_pro:entry_data}

Display the View Count for a single entry

The view_count tag will return the number of times the user has viewed an entry.

{exp:lasting_impressions_pro:view_count entry_id="{entry_id}"}

 

 

Display the Last Viewed date and time for a single entry

The last_view tag will return the date and time that the user last viewed an entry. Use the EE date formatting codes to display the date and time.

{exp:lasting_impressions_pro:last_view entry_id="{ entry_id}" format="%F %d %Y - %g:%i:%s"}

Display the most popular Entries for all users.

The most_popular tag pair will display the most popular entries visited by all users.

In order for this to work, the register tag must have the enable_reporting parameter set to "yes".

This tag works in the same way as the EE channel_entries tag pair, so you can use the same parameters and any of your custom fields within it.

{exp:lasting_impressions_pro:most_popular limit="5"}
{if no_results}
No Results
{/if}
<div>
<p>{entry_id}</p>
<p>{title}</p>
...other custom fields ...
</div>
{/exp:lasting_impressions_pro:most_popular}

limit="nnn"

Optional. Set a limit to the number of entries you want to display. If ommited, the tag will default to the limit set in the Lasting Impressions config file. You can change this if you like, look for the key li_most_popular_limit in the add-on's /config/config.php

Control Panel

The Lasting Impression Control Panel interface is comprised of these options:

Buy Lasting Impressions Pro

Lasting Impressions Pro is available to purchase from the EE Add-on Store