User Tools

Site Tools


wiki:aw:configure

This is an old revision of the document!


Configuring the site

Like all previous versions of the alternative website, all settings are now held in one place - the cmxConfig object held in the page-control.js file.

This object holds the location of the menu to use, the location of your data, the path and name of your menu, the location of your NOAA Reports and other features that the website uses. This object is stored locally on your machine as 'SessionStorage' so is only stored for the current browsing session and will not be retained once the browser is closed.

Initial Configuration

Before any page is fully loaded your browsers current Session Storage is checked to see if a copy of the cmxConfig object already exists, if it does, it is used to configure the page. If it does not not then it is created. This is then used throughout the site to access data, theme colours and other configurable options.

Below is an explanation of the critical entries.

Data

This points to the location of your *.json data files1) uploaded by CumulusMX. CumulusMX normally uploads these to the same location as the *.htm page files. This entry allows you to use a custom locations.

See more

NOAA Reports

Unlike general data CumulusMX allows you to specify your own location for any NOAA reports that you choose to publish. The default location is 'Reports/'. This is a relative path and so a sub-folder of your site. If you choose an alternative location then you can use this entry to provide the required access.More

This should be used to point to the javascript menu file used to drive all the menus on the site. Unless you use your own modified menu, there should be little need to edit this. Its default value is js/ows-menu.js. More details about creating your own menu can be found on the page Creating your own menu.

Custom

This area is used to configure other user settings. This is covered in detail in the wiki:aw:cmxConfig

Other entries are covered in the page devoted to wiki:aw:cmxConfig

The cmxConfig object

cmxConfig = {
    Charts: {
        Trends: '',
        Historic: '',
    },
    Custom: {
        StandardMenu: false,
        Dropdown: true,
        Theme: '',
       	Logo: '',
	BannerImage: '',
	StaticHead: true,
	StaticFoot: true,
	PaddingTop: '2',
	PaddingBottom: '1',
	PaddingUnits: 'em',
    },
    Data: '',
    Menu: 'js/ows-menu.js',
    NOAAReportPath: 'Reports/',
    Gull: {
        Animation: '',
        Speed: 10,
        OnTop: false,
    },
    Records: {
        All: '',
        Monthly: '',
    }
};

Non-critical entries

The Gull

As in the AI, the seagull is animated. The three settings for the gull determine the animation to use, the speed in seconds of that animation and whether or not the gull sits on top of or below other page content.

More

The remaining entries

As stated above, the sections Charts and Records are dynamic; they are set when visitors select specific charts or record sets. They relate to the charts - Trends and Historic, and Records - Monthly and All Records.

If you set them in cmxConfig then the chart you set will be the one visitors see first. Valid entries are:

Trends: 'temp', 'dailytemp', 'press', 'wind', 'windDir', 'rain', 'dailyrain', 'humidity', 'solar', 'sunhours', 'airquality', 'extratemp', 'extrahum', 'extradew', 'soiltemp', 'soilmoist', 'leafwet', 'usertemp' or 'co2'.

Historic: 'Temp', 'Press', 'Wind', 'Humidity', 'Rain', 'Solar', 'DegDays', 'TempSum', 'ChillHrs' or 'Snow'.

Of course, if your system does not generate a chart it is pointless to force it to display by default. However, the site will gracefully inform the user that no data has been found.

As the Records pages already select the most appropriate record set, I have not included the options for these but there is no reason why they cannot be pre-set: use 1 to 11 for months and Alltime, ThisYear and ThisMonth for others.

Dynamic Configuring

In previous versions I included a command in page-manager.js to clear the sessionStorage on every page load. I have not included this in this version although it is still a valid command.2)

My preferred method is to use the Developer Tools available in most browsers and to edit the sessionStorage variable directly. For my Alternative Public Website the variable always ends: cmxConfig. You should be able to edit the Values directly and see the effect simply by refreshing the page.

If this is not possible, for whatever reason, simply close the browser and reload the page. The session variable will have been deleted and whatever you have stored in the page-control.js cmxConfig variable will be used.

1)
and the realtimegauges.txt file
2)
For info the command is sessionStorage.clear()
wiki/aw/configure.1760344902.txt.gz · Last modified: by Neil