Skip to content

Visited page history

Mark Croxton edited this page Oct 3, 2013 · 2 revisions

Use unique="yes" to remove duplicate ids, which would be created if the user reloads the same page. Use limit="9" to limit to a total of 10 past entries (the previous 9 + the current page):

{exp:stash:set_list name="history" save="yes" scope="user" parse_tags="yes" replace="yes"}
   {exp:stash:get_list name="history" scope="user" unique="yes" limit="9"}
      {stash:entry_id}{entry_id}{/stash:entry_id}
   {/exp:stash:get_list}  
   {exp:channel:entries limit="1"}
      {stash:entry_id}{entry_id}{/stash:entry_id}
   {/exp:channel:entries}
{/exp:stash:set_list}

{exp:stash:get_list name="history" scope="user" unique="yes" backspace="1"}{entry_id}|{/exp:stash:get_list} 
Clone this wiki locally