Hi, There are different ways to implement hierarchies in Cargo - the right approach depends a lot on the size of the data set, how well-structured it is, how much it's going to change, etc. What you're doing now sounds like a reasonable approach, though. Though I don't understand what you mean with the "place:" namespace - categories are defined with the "Category:" namespace.
Autocompleting only on values that match with the "Type" value selected in the form makes sense - and thankfully this can be done with "values dependent on": https://www.mediawiki.org/wiki/Extension:Page_Forms/Input_types#Dependent_autocompletion -Yaron On Wed, Sep 1, 2021 at 9:58 PM David Epstein <david...@umich.edu> wrote: > Thanks Yaron. Two followup questions: > > (1) How would you implement a hierarchy of place types using Cargo? Would > you just have a TYPE field (nation, city, neighborhood) and PARTOF field > with all pages being part of category PLACE? Or would you try to do > something more sophisticated with categories (place:nation, place:city) ? > > (2) Is there any way to autocomplete on a set of pages that match a query? > Perhaps a query that draws from the current contents of form pulldown > menus, etc? > > On Wed, Sep 1, 2021 at 9:09 PM Yaron Koren <yaro...@gmail.com> wrote: > >> Hi David, >> >> I believe this is two separate issues. The first is, I believe, due to a >> bug that existed with #template_display, where it didn't display links for >> fields of type "Page" that also have a list of allowed values defined for >> them. I just checked in a fix for this, so if you get the latest Page Forms >> code, it should hopefully work correctly. >> >> The second isn't actually a bug, I don't think. When you set >> autocompletion for a field of type Page, you have two choices: you can >> autocomplete based on values that have already been entered for that field, >> or you can autocomplete based on the set of wiki pages that the field is >> meant to hold. By default, it's the first one - which means that you will >> only see a value in the autocompletion after it's been entered at least >> once. Ultimately, it probably doesn't really matter which one you do - but >> if you stick with this approach, you'll need to manually enter each value >> once. >> >> -Yaron >> >> On Wed, Sep 1, 2021 at 2:08 PM David Epstein <david...@umich.edu> wrote: >> >>> Hi folks, >>> >>> I'm working with Cargo, PageForms, and PageSchemas. I'm trying to define >>> a hierarchy of places (all assigned to category "Place"). I'm probably >>> doing several things wrong. The hierarchy is roughly: >>> >>> SolarSytem- -> Planet --> Continent --> Nation --> SubRegion --> City >>> --> Neighborhood >>> >>> I used PageSchemas to generate a "Place" Cargo table, Form, and >>> Template. It has two fields right now. (1) The "Type" Cargo field is a Page >>> with a list of possible inputs from the hierarchy above. The "Type" >>> Template is text with autocomplete. (2) The "PartOf" field is identical >>> except it has no list of possible inputs since I was hoping it would draw >>> from page instances. >>> >>> When I choose a Place "Type" from the list, the selection is displayed >>> as static text, not as a link (even if I manually create a page with the >>> same name). When I try to choose a Place "PartOf", autocomplete never finds >>> the places I've already generated. >>> >>> What is the proper way to create such a hierarchy? My approach does not >>> generate real subcategories like Place:SolarSystem and Place:Planet. Is >>> that what I should be doing? Does that require each subcategory to have its >>> own schema, form, and template? >>> >>> Thanks for your guidance, >>> -david >>> >>> >>> >>> >>> _______________________________________________ >>> MediaWiki-l mailing list -- mediawiki-l@lists.wikimedia.org >>> List information: >>> https://lists.wikimedia.org/postorius/lists/mediawiki-l.lists.wikimedia.org/ >>> >> >> >> -- >> WikiWorks · MediaWiki Consulting · http://wikiworks.com >> _______________________________________________ >> MediaWiki-l mailing list -- mediawiki-l@lists.wikimedia.org >> List information: >> https://lists.wikimedia.org/postorius/lists/mediawiki-l.lists.wikimedia.org/ >> > _______________________________________________ > MediaWiki-l mailing list -- mediawiki-l@lists.wikimedia.org > List information: > https://lists.wikimedia.org/postorius/lists/mediawiki-l.lists.wikimedia.org/ > -- WikiWorks · MediaWiki Consulting · http://wikiworks.com
_______________________________________________ MediaWiki-l mailing list -- mediawiki-l@lists.wikimedia.org List information: https://lists.wikimedia.org/postorius/lists/mediawiki-l.lists.wikimedia.org/