Pass a message to another page

I want to have a banner than I can pass a callback message to users with.

So for instance if they access a page that is behind a payment wall, I want to redirect them to the payment / subscription page and show the message banner with “you need to subscribe to access that” or similar message.

I have a re-useable Group element at the moment with a custom state of “message” that is hidden if it’s content is empty.

The problem I am having is that I cannot set the state of the banner and have it persist from one page to another.

The only other thing I can think of is that I need to store user messages to the DB and load any messages page to page, I would rather not do that though.

You could pass a URL parameter and set the state based on the value of the parameter.

Thanks for you reply, that only really works if I have a bunch of pre-saved banners with fixed messages that I am flipping on and off. What I really want is to have one banner with dynamic content that I can change as needed, the toggling I can then do for warning/info styling.

I don’t want to have to put big blocks of text in the url as parameters although technically I could.

Only other solution I can think of would be to set a cookie on that user to carry the message. Haven’t used it myself but I believe there is a “cookies/local storage” plugin.

Maybe create an Option Set which contains a list of the various messages you might need to show.

Then, where a message is required, pass a URL parameter referencing the index of the message you want to show alertmessage=1 for instance.

Not 100% dynamic, but 1/2 way there.

1 Like

well I guess it at least keeps the page building side of things lower as I just need to manage the option set. To be honest though, if I was to implement this option I think I would rather just have a “message” table with [user,message,messageType] that populated the group on any page and deleted the message (or archived it) once dismissed.

This is an interesting avenue, I wonder how it would play with cookie blockers though.

I think I follow and yeh, that makes sense.
The nice thing with Option Sets is that they’re snappy as they don’t require any DB lookup and come pre-loaded with each page.

1 Like

I will have a think on it, it certainly has a degree of re-usability and easy maintenance that I think I too quickly dismissed. I think the telling point will be how many standard message examples I have and whether they need any dynamic content from a prior action. I guess depending on the dynamic content I could cobble together the two avenues of URL param and option set.

1 Like

Perhaps not the most lightweight option, however this should do what you want.

Create a text field in user called “banner message”.

Setup a conditional workflow on the page with the condition when current user’s banner message is not empty. (Bonus points: You need only add this conditional workflow once to a reusable banner element.)

In the workflow, you can send the data from the field to your banner. If you only want to show this message once, then you can clear “banner message” by updating the user’s thing.

Caution: if your user has multiple sessions open, the message will be sent to all those sessions with the above. This may or may not be desirable. Similarly, if the next window is never opened and then the user returns later on, the last out of date message will be shown. The work-arounds for both of these situations would be to use some kind of logic / state variables to only load “banner message” once on page load and to delete old banner messages automatically.

If I read this correctly this would ultimately be the same as implementing a message table so not really what I am after.

1 Like

This topic was automatically closed after 70 days. New replies are no longer allowed.