Extension talk:Page Forms

How can I display a list of subcategories of a given category in a dropdown?
I'm building a form where I want to let users select a category in which to place the new page. I've tried getting this list of categories from:

1) Cargo - it appears to only let you query data created to store in Cargo

2) CategoryTree - it seems like you can only render collapsible lists in HTML

3) DynamicPageList3 - this seems to work pretty well, but renders categories as links, not as plain text that can be comma-separated and used with the "values" property.

I could use Cargo to store this list of categories separately but I'd prefer not to create a second source of truth for categories.

Any ideas? Nicholasalanbrown (talk) 04:01, 9 January 2023 (UTC)


 * I'm guessing that there are ways to do this with both Cargo and DPL3, but the simplest approach might be to use "input type=tree", with the "top category=" parameter. It's not a dropdown, but hopefully it's close enough - and it will be especially helpful if you ever have more than one level of subcategories. Yaron Koren (talk) 14:04, 9 January 2023 (UTC)
 * I use this approach:.
 * I've found Cargo's storage of categories in the _pageData table to be completely unreliable (it might just be a problem with my databases) but I think the approach here uses category information straight from MediaWiki. Jonathan3 (talk) 10:37, 24 January 2023 (UTC)
 * You must use own template code. Use: Extension:ParserFunctions, Extension:Loops, Extension:Variables and code for DPL which I wrote for you here -- Want (talk) 21:43, 9 January 2023 (UTC)

Get the value of a field the user has completed/selected?
I have a form that has two dropdowns, one for country, one for state/territory. Is there any way to populate the list of states/territories depending on which country is selected? I have both countries and states/territories stored as categories, the issue is I need one field to react to the value of an earlier selection. How do I get the value the user selects for country? This this would be straightforward with jQuery, wondering if that's the only way or if Page Forms can accomplish this somehow. Nicholasalanbrown (talk) 04:00, 13 January 2023 (UTC)


 * Yes, it's doable if you're also using either Cargo or SMW to store the data; see Dependent autocompletion. Yaron Koren (talk) 19:12, 13 January 2023 (UTC)
 * After a few days of playing with "values dependent on" I realized this feature does not work as I expected.
 * For context, I have three Cargo tables/forms/templates: Proposals, Countries, and Regions.
 * What I want to achieve is the following:
 * I manage relationships between Regions and Countries by storing a "Country" field in the Regions Cargo table, as well as a field in the template.
 * In the Proposal form I have two comboboxes, one for Country and one for Region, for the latter I have a "values dependent on=Proposal[Country" property, as I've seen in many examples.
 * What I was hoping would happen is that after selecting a Country, the Region combobox would only show Regions Cargo table records where the value of "Country" was the same as that I had selected (e.g. if I selected "United States" in the Proposal Form, I'd only see states like "Alabama" appear and not provinces of Canada).
 * What actually happens is that the "Country" combobox shows only whatever Countries have been included in Proposal data, not all Countries from the Cargo Countries table. Similarly for the "Region" combobox, it shows any Regions stored alongside the selected Country in existing Proposal entries. I am aware that I can fix the "Country" issue by explicitly calling the cargo table and cargo field properties, but I'm not sure how to achieve the desired behavior for "Region."
 * Is what I am trying to achieve possible with Page Forms? Perhaps it's possible to use the "cargo where" property listed in the docs (I have not been able to find any examples of this). Nicholasalanbrown (talk) 03:25, 18 January 2023 (UTC)
 * Right - unfortunately, the way dependent autocompletion is defined, you can only get the dependent values for the region from the "Proposals" table, not the "Regions" table. I'm aware that sometimes that's not the ideal behavior, but that's how it's done right now. One hack you can do to get around this problem is to create a page with a whole bunch of calls to the "Proposal" template, one for each country and region. It's not an ideal solution, because it creates a whole bunch of bad data, but if all the data is confined to one page, then maybe it's not a huge problem. And that way the autocompletion will work. Yaron Koren (talk) 19:10, 18 January 2023 (UTC)

[solved] How to create page names with underscores
When creating a new page with PageForms, underscores in page names get converted to spaces by Mediawiki. How can I prevent this? I need a page with the name "test_test" and not "test test". RacingRalf (talk) 09:29, 13 January 2023 (UTC)


 * MediaWiki by default doesn't allow underscores in page names; you can get around this problem by calling DISPLAYTITLE - see here for an example. So I suppose you could add a call using a combination of DISPLAYTITLE, #replace (from ParserFunctions) and PAGENAME to the relevant template, assuming you want to have underscores for every such page. Yaron Koren (talk) 19:18, 13 January 2023 (UTC)


 * Thanks again Yaron!

[solved] Problem creating page with similar name to old page
I want to create a new page. The first 91 characters of its title are the same as the first 91 characters of an existing page's title (including 5 for the namespace and 1 for the colon). When I try to create the new page, I am taken to the form for the existing page instead... Jonathan3 (talk) 10:29, 24 January 2023 (UTC)


 * Those are some long page titles! Anyway, I assume you're talking about #forminput. Could it be that it's autocompleting on the existing page name? Yaron Koren (talk) 14:45, 24 January 2023 (UTC)
 * I concede that the titles are long :-)
 * The #forminput has an autocomplete on category parameter so I'll see what happens with that removed. Jonathan3 (talk) 15:27, 24 January 2023 (UTC)


 * I can't remember which page it was doing this with, and can't get it to happen again today, so it looks like I'll never know. I'll mark it as solved anyway! :-) Jonathan3 (talk) 22:48, 27 January 2023 (UTC)

Edit text of "Create or edit" button?
Is there any way to edit the text of the "Create or edit" button that appears in step one of the two-step process? Nicholasalanbrown (talk) 02:08, 29 January 2023 (UTC)


 * Yes, with the "button text=" parameter of #forminput. Yaron Koren (talk) 20:09, 2 February 2023 (UTC)
 * Thanks! I'll try that. Nicholasalanbrown (talk) 02:05, 5 February 2023 (UTC)

Sort order for inputs
I have a field. Property HasCredential has a list of allows value entries that is alphabetically sorted. When I start typing in the input field the options come up as driven by the property, but they are not sorted. I had a similar problem with a field which sorted all but one value correctly. I replaced that one with a manual list but that's obviously not desirable. Is there anything I can do to sort the values alphabetically? I searched the discussion pages and similar things have come up occasionally but I didn't find a solution. I asked this question some weeks ago, but that post was archived without any answers, so I am re-posting. Tenbergen (talk) 19:53, 2 February 2023 (UTC)


 * That sounds like a bug. Is there any order to the sorting? And do "property" vs. "values from property" result in different sorting? Yaron Koren (talk) 20:11, 2 February 2023 (UTC)

Nested multiple-fields for planning a rollout
Hello everyone,

I would like to develope a form to plan a rollout for our IT department. My idea was to have a form with template-fields with the property multiple. So you can add multiple elements via one form.

My approach was to have a page for the main location - building. On this page I add rooms. Inside these rooms I want to add tasks. However, "multiple" seems to not support nesting.

My stripped version of the code looks like this:

Since this doesn't seem to work, I'm struggeling to find an alternative. I would appreciate if someone could give me a hint for a different approach.

Thank you kindly in advance. Fmilk (talk) 07:16, 3 February 2023 (UTC)


 * Yes, unfortunately multiple-template instances can't be nested inside one another - you are restricted to just a two-dimensional table of data within a page, not more dimensions than that. I think the only solution is to have separate pages for rooms and/or tasks. Yaron Koren (talk) 14:03, 3 February 2023 (UTC)

Cargo mapping value field
I think I'm misunderstanding the idea behind the mapping cargo value input. I was hoping it would allow for a form input to display a field from a cargo table and save a different field from that same row to the form template.

In my example regardless of what I put in cargo value field, the result only saves what is in cargo field.

Here is my example Form - this form saves to a cargo table called PeopleAlternateName

The PeopleID is a combobox, which I would like to display the field Name from the People table - this is working. But I was hoping the value field which is the ID field from the People table would be the value saved in the cargo table - instead it is saving the field Name

Is the cargo value field for something else - and not what I am trying to achieve here? Thank you for any help. Temujen510 (talk) 22:07, 12 February 2023 (UTC)


 * I think that field tag should instead look something like:
 * Sorry that this looks so complicated - part of what makes it so "busy" (five parameters) is the seemingly unusual setup you have, where each Person page has both a Name and ID field, but neither one is the page name. (I think.) Yaron Koren (talk) 21:42, 13 February 2023 (UTC)
 * Thank you!
 * I had wondered what the difference was between cargo table=people and mapping cargo table=people, but I think I understand now.
 * I added the extra mapping to the final cargo value field=ID, and everything worked great. Temujen510 (talk) 21:55, 13 February 2023 (UTC)
 * I added the extra mapping to the final cargo value field=ID, and everything worked great. Temujen510 (talk) 21:55, 13 February 2023 (UTC)

Can checkbox fields also store values as 0/1 in templates?
Good evening y'all

The checkbox fields in my form store values as Yes/No in templates. That's in contrast to radiobuttons, which store them as 0/1 in templates; both being Boolean of course. Is it normal for checkbox fields to store values as Yes/No, or could one of my configurations be causing this?

Btw, Yes/No values are correctly stored as 0/1 in the associated Cargo table (the checkbox variables are set to Boolean in #cargo_declare). However, if possible it would still be useful to have the values stored as 0/1 in the wikitext. E.g., to use Boolean expressions on the page that holds the template. For instance, to display a warning message if parameters 1, 2 and 3 are all true.

Cheers, Devaroo (talk) 22:14, 16 February 2023 (UTC)


 * I didn't know that the "radiobutton" input type, when used with a Boolean field, printed out 0 or 1 onto the page - that might be a bug, actually. But what is the call (presumably using ParserFunctions) that can only work if 0 and 1 are used, not No and Yes? Yaron Koren (talk) 02:40, 17 February 2023 (UTC)