Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2014-12-14 19:53:46

mericson
Member
Registered: 2004-05-24
Posts: 137
Website

How to... Banner notifications users can choose to 'hide'

I’d like to add ‘banners’ to my site that have a clickable widget to hide/supress the display of a banner.

Think of some site/system notification or promotion at the top of a website. It will display everytime until a user selects a ‘hide’ option for that particular banner.

I’m thinking of each banner being its own article, and preferrably storing the ‘hidden’ status in a cookie so it doesn’t involve any database storage, and it works anonymously.

Seems like a common pattern, anyone know of Plugins to help support this?

Thanks!

-Mark

Last edited by mericson (2014-12-14 19:53:59)

Offline

#2 2014-12-14 20:00:14

ruud
Developer Emeritus
From: a galaxy far far away
Registered: 2006-06-04
Posts: 5,068
Website

Re: How to... Banner notifications users can choose to 'hide'

You don’t need a plugin to do that. Setting the cookie can be done with Javascript on the client side. You can put the banners in a separate section in TXP, display them randomly using article_custom and remember (Javascript) each hide buttom that your visitors click (hint: don’t use separate cookies for each article, but store it all in a single cookie. All you need to store is the article number).

Offline

Board footer

Powered by FluxBB