Skip to content

Developer notes

dispatch_before_display puts the bars that may show on the current page into the page as JSON (#kv_ab_data), filtered by page, status and end date. The page output is the same for every visitor.

The browser picks the bar per position: dates, dismissal (localStorage key with the bar ID and its last change), and, only when a bar needs it, country and customer groups from kv_announcement_bars.context. That request is POST and answers with Cache-Control: no-store.

hooks/index/body.pre.tpl adds the top slot and the data. hooks/index/scripts.post.tpl adds the script and its texts.

Table Contents
?:kv_ab_bars Settings of each bar
?:kv_ab_messages Messages: order and link
?:kv_ab_message_texts Text per message and language

Bars::isOn() decides whether the page gets bars and whether the context request answers.