Poll page :: Code Examples
The code below is an example of how a ward results page should be marked up. This is the core of the information, and the other pages are really just enabling us to find this information.
Several different levels of markup have been done to illustrate both basic markup and what to do where more detailed information is available.
The code is very well commented, but a couple of things are worth pointing out:
- Where possible political parties should be uniquely identified using an resource URI (e.g. The Labour Party is uniquely identified by http://openelectiondata.org/id/parties/6). There is a list of all the official parties, together with their resource URIs on this page. (The id at the end of the URI, by the way, is the Electoral Commission id for the party, and this also means if you store this it's also easy to link to the Electoral Commission website page for the party.)
- You need to uniquely identify the poll using a resource URI (this is a URI that relates just to this poll, a poll being an election taking place in a ward on a given date). You also need to identify the ward/electoral area by a resource URI. To make it easy for you, we've produced these and have also made it trivial to discover them -- just go to our helper, choose your council and the election date, and you'll get a list of them.
You can also see a live example of an ward results page (with appropriate markup) here