Skip to content

Toggle announce block #6097

Answered by kamilkrzyskow
Andygol asked this question in Q&A
Sep 28, 2023 · 3 comments · 2 replies
Discussion options

You must be logged in to vote

Hmm, so from the OP I got that you want:

  1. The announcement block to be hidden by default even though the user never dismissed the message. Which means also that after a page refresh it will go back to being hidden, right?
  2. The option to open and close the announcement bar at will with a button located next to dark mode switch.

With that information, I guess, you can omit adding any cookies, as after opening the announcement block and refreshing the website it would close and return to the default behaviour.

Here is a working example given the points above:
custom-info.zip

I made some changes to the approach and the info.html partial (it now hides only the second button, also the labels ar…

Replies: 3 comments 2 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@Andygol
Comment options

Comment options

You must be logged in to vote
1 reply
@Andygol
Comment options

Answer selected by Andygol
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants