eranroz added a comment.
Herald added a subscriber: PokestarFan.

I thought about this and I came up with the few possible TempldateData solutions:

  1. Wikidata map (see T69659 just appear above). and then we can handle it either in the frontend or backend:
    • Backend
      • Once we have such, we can add Hook in extensions/TemplateData/api/ApiTemplateData.php with CreateTemplateDataResponse - letting other extensions override the templatedata response.
      • In extensions/Wikibase/Wikibase.hooks.php handle it by iterating the map and generating ['default'] value for the TemplateData (e.g the default here is dynamic).
    • Frontend
      • VE should treat it in modules/ve-mw/ui/dialogs/ve.ui.MWTemplateDialog.js - this requires uglifiying the VE code (adding Wikidata specific binding code to more general code), and requires the client side to query the RepoApi for the actual values of the wikidata. I tried to create POC for it and realize this is probably bad idea...
      • Note: In the long term solution, we may want tight integration of WD in VE template allowing to edit WD - but this is not in the scope of this task but rather so I would rather avoid depending on it
  2. (ab)use default with values such as default: '{{#property:P123}}' for parameters. With or without parsing:
    • Without parsing - this is the current behaviour of TD and doesn't require any code changes. This may be somewhat meaningful even for pages not yet connected to wikidata (e.g "this parameter may be auto filled once connected to wikidata")
    • With parsing - Requires TD to call parser for default (and do it dynamically - not on TD save as it is page dependent). While requires the page to be already connected to wikidata, it is more meaningful (e.g show the actual data from wikidata rather then some wikisyntax for fetching wikidata). Note this requires also adding new page parameter to the TD api so it will know the context for parsing



To: eranroz
Cc: eranroz, PokestarFan, Kippelboy, Amire80, Aklapper, Necroarcano, Robinma, GoranSMilovanovic, chapulina, QZanden, merbst, Wess, JGirault, Nizil, Srdjan_m, Ixocactus, Izno, Jrf, Husun1297, Wikidata-bugs, aude, Deskana, Mvolz, Swainr, Jsahleen, Arrbee, santhosh, KartikMistry, Mbch331, Jay8g, Ltrlg
Wikidata-bugs mailing list

Reply via email to