Index

Page Backgrounds

Within the WebBrick Gateway it is possible to create context sensitive backgrounds. This would be done for a number of reasons:

Background images can be found at the directory specified for /static/images/background in the configuration file.

This is supported by the boilerplate page template as the body type has a widget type (wbType) of Background and a uri that provides the name of the current background image. So periodically the page will request the background uri from the WebBrick Gateway and update the page. It is possible to setup dynamic backgrounds for different page elements other than the body which corresponds to the whole browser display.

Configuration Example

Here's a example configuration that changes the background every 15 minutes.

<eventInterfaces>
    <eventInterface module='EventHandlers.EventMapper' name='EventMapper' category='debug'>
        <eventtype type="">
        
            <!-- periodically change the background on the user interface. -->
            <!-- This could be done on second/minute/hour intervals as well. -->
            <eventsource source="time/minute" >
                <event>
                    <params>
                        <testEq name='minute' value='0' />
                    </params>
                    <newEvent type="http://id.webbrick.co.uk/events/state" source="background">
                        <other_data val='/static/images/backgrounds/WebBrickGatewayBackDrop1.png'/>
                    </newEvent>
                </event>

                <event>
                    <params>
                        <testEq name='minute' value='15' />
                    </params>
                    <newEvent type="http://id.webbrick.co.uk/events/state" source="background">
                        <other_data val='/static/images/backgrounds/WebBrickGatewayBackDrop2.png'/>
                    </newEvent>
                </event>

                <event>
                    <params>
                        <testEq name='minute' value='30' />
                    </params>
                    <newEvent type="http://id.webbrick.co.uk/events/state" source="background">
                        <other_data val='/static/images/backgrounds/WebBrickGatewayBackDrop3.png'/>
                    </newEvent>
                </event>

                <event>
                    <params>
                        <testEq name='minute' value='45' />
                    </params>
                    <newEvent type="http://id.webbrick.co.uk/events/state" source="background">
                        <other_data val='/static/images/backgrounds/WebBrickGatewayBackDrop4.png'/>
                    </newEvent>
                </event>

            </eventsource>
        </eventtype>
    </eventInterface>
</eventInterfaces>