Update – March 2015: The Citizen Space WordPress plugin is now deprecated. We no longer recommend it as a way to integrate Citizen Space with WordPress. If you are using this plugin in your WordPress site, please see the article How do I integrate Citizen Space into my existing website? for alternatives, or get in touch with us at firstname.lastname@example.org.
We are very excited about the new API (or Application Programming Interface) that’s included with version 1.6.5 of Citizen Space, because it provides a standardised, documented way for third-party software to communicate with Citizen Space. However, the second word of that acronym, ‘programming’, is a bit off-putting for some people; writing software is not everyone’s cup of tea!
We know that lots of our clients currently use WordPress for parts of their online presence, so the first thing I wanted to build using the API was a plugin for WordPress. I wanted people to be able to embed consultation listings, search facilities and entire consultation records into their WordPress sites, without having to know PHP or any other programming language.
WordPress provides a handy facility called shortcodes. These are keywords written in square brackets [like this]. If you type one of these shortcodes into a blog post or page, WordPress interprets it in a special way and replaces it with dynamically generated content. If you download and install the Citizen Space plugin in your WordPress site, you will have four new shortcodes available to you:
If you want to embed a fully functional consultation finder in your WordPress site, all you need to do (after installing the plugin) is paste the 3 lines below into your page or post:
If you are confident with writing PHP code, please feel free to fork the plugin code on Github and submit your own contribution, or use it as the basis for your own Citizen Space integration project. If you find this code useful, we’d love to hear from you.