MediaWiki extension JsonData

Clone this repo:
  1. 8f4b9a8 build: Updating eslint-config-wikimedia to 0.27.0 by libraryupgrader · 8 days ago master
  2. 516ee73 Use HookHandlers and implement hooks by Fomafix · 10 days ago
  3. b5a9cb7 Use self::class instead of __CLASS__ to reference the self class by Fomafix · 1 year, 1 month ago
  4. 6e53b54 Declare private properties by Fomafix · 10 days ago
  5. d79c23e build: Updating mediawiki/mediawiki-codesniffer to 43.0.0 by libraryupgrader · 6 weeks ago REL1_42

This is an extension which allows for form-based editing of arbitrary JSON data on-wiki. To see this in action, visit http://jsonwidget.org/wiki/JsonData

Installation instructions for JsonData

  1. Copy the extension as "JsonData" into the extensions directory
  2. Configure the extension in LocalSettings.php. An example configuration can be found in example/LocalSettings_example.php

This should be enough to get up and running.

Testing

A few tests to try with the example configuration:

  1. Create a page "Address:Test". This is an example of a basic address book.
  2. Create a page "Data:Test". This is an example of free-form JSON editing sans schema.
  3. Copy an example schema to the wiki. Create "Schema:SimpleAddr", and copy in the contents of simpleaddr-schema.json. Surround the contents with a tag.
  4. Move your config on-wiki and make a modification a. Copy the contents of example/configexample.json to a new article called "JsonConfig:Test". Be sure to leave either or tags around the JSON data. b. Set $wgJsonDataConfigArticle = "JsonConfig:Test" in LocalSettings.php c. Edit JsonConfig:Test, changing the following values: ['tags']['address']['schema']['srctype'] from "predefined" to "article" ['tags']['address']['schema']['src'] to "Schema:SimpleAddr"
  5. Edit "Schema:SimpleAddr", adding or removing a field
  6. Create a page "Address:Test2", and note your change to the schema.