You are here: Foswiki>Tasks Web>Item13522 (30 Sep 2019, MichaelDaum)Edit Attach

Item13522: Site BROADCAST message should be closable, hide it once a user acknowledges it.

Priority: Enhancement
Current State: Closed
Released In: n/a
Target Release: n/a
Applies To: Engine
Component: FoswikiTemplates
Reported By: GeorgeClark
Waiting For:
Last Change By: MichaelDaum
Summary says it. The Broadcast message is clutter and in the way once a user has seen it.

diff --git a/core/templates/foswiki.tmpl b/core/templates/foswiki.tmpl
index 9f4264b..ca7b25a 100644
--- a/core/templates/foswiki.tmpl
+++ b/core/templates/foswiki.tmpl
@@ -74,7 +74,7 @@ but may be used in derived templates.
 }%%TMPL:DEF{"broadcastmessage"}%%IF{"defined FOSWIKI_BROADCAST and $FOSWIKI_BROADCAST != ''" then="$percntTMPL:P{$quotbroadcastmessage:system$quot}$percnt"}%%IF{"defined BROADCASTMESSAGE and $BROADCASTMESSAGE != ''" then="$percntTMPL:P{$quotbroadcastmessage:contents$quot}$percnt"}%%TMPL:END%%{
-}%%TMPL:DEF{"broadcastmessage:contents"}%<div class="foswikiBroadcastMessage"> %BROADCASTMESSAGE% </div>%TMPL:END%%{
+}%%TMPL:DEF{"broadcastmessage:contents"}%%TWISTY{ id="%BROADCASTID%" class="foswikiBroadcastMessage" showlink="" hidelink="<span class='ui-icon ui-icon-closethick'></span>" remember="on" firststart="show" }% %BROADCASTMESSAGE% %ENDTWISTY%%TMPL:END%%{
 }%%TMPL:DEF{"broadcastmessage:system"}%<div class="foswikiAlert"> %FOSWIKI_BROADCAST% </div>%TMPL:END%%{

This adds a new setting BROADCASTID ... the twisty remembers the state of any unique ID. To publish a new message, need to set BROADCASTMESSAGE and also increment the BROADCASTID

-- GeorgeClark - 14 Jul 2015

This is implemented on using a template override: Do we want to make this a default behavior?

-- GeorgeClark - 25 Sep 2016

Sure, looks useful.

-- Main.CrawfordCurrie - 08 Jan 2017 - 16:59


ItemTemplate edit

Summary Site BROADCAST message should be closable, hide it once a user acknowledges it.
ReportedBy GeorgeClark
Codebase 2.0.0
SVN Range
AppliesTo Engine
Component FoswikiTemplates
Priority Enhancement
CurrentState Closed
TargetRelease n/a
ReleasedIn n/a
Topic revision: r4 - 30 Sep 2019, MichaelDaum - This page was cached on 12 Sep 2020 - 22:50.

The copyright of the content on this website is held by the contributing authors, except where stated elsewhere. See Copyright Statement. Creative Commons License    Legal Imprint    Privacy Policy