Topic on Extension talk:TemplateData

קיפודנחש (talkcontribs)

one of the oldest, and widely used parser function is #switch

when a template uses a parameter as feeder to #switch, templatedata should be able to list the "legal" values, and also allow indication whether the #switch expression has #default clause, so a wizard will be able to provide a drop-down with the values, and optionally make it a "drop down combobox" which allows the user to feed a value not in the list.

if such syntax already exists, and it's only my ignorance speaking, please teach me. otherwise, please add switch property (call it whatever - html uses "select" and "options" i think), e.g.

"params": {
  "bla": {
    "description": "bla bla bla",
    "switch": ["preset value 1", "preset value 2" ...],
    "other": true
  }
}

peace.

Whatamidoing (WMF) (talkcontribs)
קיפודנחש (talkcontribs)

no. i'd like to see phab:T144155 also solved, but it's not the same issue.

in hewiki, we have "template wizard" since circa 2012, so it predates templatedata. we created our own "metadata" spec, which supported both the "boolean" attribute in the ticket, and a "select" attribute. the UI would present a checkbox for "boolean -like" parameters - selecting it would set the parameter to the prescribed value defined by the metadata. we had a separate "select" attribute, with "options" values, which behaved much like html "select" - the input field for such parameter was a drop-down listbox, so the editor would select one of predefined values, instead of a free text field as is with "normal" parameters.

some time after the introduction of templatedata, we modified our wizard to use templatedata instead of our "proprietary" metadata format, but we are missing the lost functionality, as described above.

peace.

Whatamidoing (WMF) (talkcontribs)
קיפודנחש (talkcontribs)

I am. I even left him a love letter on his talk page on enwiki a while ago. Twisi, his wizard is crippled by not being able to digest an existing template on the page, so it's a one-shot thing: get it right the first time, or you're on your own. My old wizard is ugly, but better behaved. Peace.

Reply to "select"