This repository is for helpful bits of code and/or advice the FCO Digital Transformation Unit have come across when using the GOV.UK prototype kit.
Each new helpful bit should be added as a file with explanations commented out.
Examples of APIs. The first one includes json to csv and download features
Program your back button so you don't need to code it per page
A way to use a single file to do all your branching / routing, instead of on a page by page basis
A simple calculator to take user inputs - no. of documents, postage choice - and calculate the total. Ensures 2 decimals are always displayed (£35.50 instead of £35.5), and caters for singular and plural of "document". Uses session data.
Useful commands, tips, help
Changing parts of a page depending on variables being present, empty etc, using in-page logic.
Tools for creating screenshots automatically
How to store data in the session, retrieve it, and clear it down. User journey starts at session-test-inputs