3

Alright, I will just dive into explaining the situation:

On a page, we have a component called the Help Message. This component will render above most of the content and continue to show until the message expires (whether its thru un-publishing or some field driven expiration). The user (which will be logged in) also has the ability to click a Don't show this anymore button which will make the message hide/not render until a new message is published. Initially I thought storing this as a PageEvent and leveraging Personalization to hide the message was the right path, but (and I could be completely wrong) from what I can tell PageEvents are within the context of a Session. I want to be sure that if I go to another browser or come back 3 months from now, I will not see the message. I have also considered programmatically adding a bool|timestamp as a custom property on the user itself, but I feel there has to be a more Sitecore-idiomatic way to achieve this. I am hoping someone here can give me a nudge in the right direction, Thanks!

  • Assuming that your user logs in and you can identify this user even if they open another browser, put this information in contact and store it in MongoDB. – Marek Musielak Nov 17 '16 at 19:58
  • Thanks, your comment reminded me to clarify the user is guaranteed to be logged in. – vandsh Nov 17 '16 at 20:06
2

You can use MongoDB to achieve what you need.

Just create a custom facet (Sitecore documentation: Create a custom contact facet) and store the information whether user chose to never show the message again inside the facet.

That will make sure you can access this information every time user logs in again, even if they use different browser.

And yes, you can use personalization for showing/hiding the component later.

|improve this answer|||||
  • Thanks, this was a huge nudge in the right direction. I found stackoverflow.com/questions/38393217/… that help me add new items to a facet collection, now I just need to setup the personalization for showing and hiding based on a contact facet. – vandsh Nov 17 '16 at 22:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.