#Form for users to update a table with new information

13 messages · Page 1 of 1 (latest)

crimson sand
#

trying to create this type of situation:

Data Store <-> script that reads and alters Data
                                                      \ < queue system for data for data integrity / administration < Users update data with a form```

With the intent of having a buildable data-store that can be community driven but is it possible to create code that will alter another page permanently?

An example of the type of data:

https://ecopedia.miraheze.org/wiki/Data:TestJSON

```{
    "Braithe Bluenail": {
        "merchantGoods": "Thread Bonding Agent^Cotton Workaday Tunic^Cotton Workaday Hose^Cotton Workaday Gloves^Cotton Workaday Boots^Cotton Workaday Cover"
    },
    "Thalbin Goldgrip": {
        "merchantGoods": "Small Hide Pouch^Leather Ring Purse^Hunting Satchel^Torch^Reliable Old Compass"
    }
}```
Ecopedia - EverCraft Online Wiki
#

@zinc gull LoL there ya go, tagged ya!

zinc gull
#

Thanks for providing this example page, it showed me that JSON has a lot of support in mediawiki actually. 👀

I'm not experienced with modifying JSON, but looks like you could use an extension to edit a JSON table after all. And then use lua to extract the data in the way you want, or even generate a table of items for you for example.

#
MediaWiki

JSON (JavaScript Object Notation) is one of the supported formats for data exchange. It is not only used internally by the software of MediaWiki core and many extensions, but with the help of third-party extensions the wiki itself can be a powerful vehicle for storing as well as working with JSON data. This page is about the latter.

#

This would be worth a read, especially the extensions that allow to edit json using forms

#

I can try and help with the lua part later if you run into any issues

crimson sand
#

Reading through that now

Apparently the form has to be in the "Form:" namespace first, so that was one thing I messed up.

crimson sand
#

Currently it works to read all, and filter

#

writing is the problem

zinc gull
#

Lua modules are usually only meant for display, not for creating interactable content for editing

#

Have you checked if the extensions mentioned on the mediawiki JSON page are available on miraheze/work?

crimson sand
#

Haven't had a chance to yet. I was browsing the page earlier tho. It seems like most the extensions that are available are really meant for observing the data and not necessarily interacting with the data in an alteration standpoint.