Wikidata talk:WikiProject Templates

From Wikidata
Jump to navigation Jump to search
Help:Templates

New template tool or variable?

[edit]

It would be really cool if one could generate a {{List of properties}} table by selecting a QID as a "pattern" and having the properties and examples populated from that QID. This would save hours of work. - PKM (talk) 21:34, 3 March 2021 (UTC)[reply]

TemplateData documentation of every template item in Wikidata.

[edit]

Mediawiki TemplateData can be used to translate a template documentation. The worst: you have to copy from a Wikipedia to another Wikipedia, to see the documentation in the destination language.

I have done it in Wikipedia Template:Short description. I have translated the TemplateData from English to Spanish (you can edit TemplateData and select "español" -this is, Spanish- to see the translation into Spanish).

The problem: I have to translate the template documentation (TemplateData of the template) in the English Wikipedia and copy and paste it into the documentation page o f the template in the Spanish Wikipedia.

This is not good. The best idea is that I could see the translation in the Spanish Wikipedia, without copy and paste, in a Wikidata manner (global documentation from TemplateData).

Also, this translation into Spanish could be seen in Wikibooks in Spanish, Wiktionary in Spanish and so on, without copy and paste the TemplateData from the English Wikipedia to Wikibooks in Spanish, Wiktionary in Spanish and so on.--BoldLuis (talk) 10:51, 15 March 2021 (UTC)[reply]

Template to embed list of instances?

[edit]
PAC2 Benoît Prieur John Samuel (talk) Jheald (talk) Lectrician1 Patsagorn Y. push-f

Notified participants of WikiProject Templates

Is there some template to embed a list of instances of a particular data item?

I see that there is {{Instance list}} but it just links https://query.wikidata.org as opposed to embedding the results directly on the wiki page like {{Tree}}.

It seems like {{Tree}} however does not support backlinks like incoming instance of (P31) links. Is there already a template for that? I am not sure, there are so many templates, I feel like I'm missing something. If there really is no such template, I'd probably try to create it.

--Push-f (talk) 17:49, 18 November 2022 (UTC)[reply]

There’s no such template, and neither can you create it – in contrast to Wikidata Query Service, the Lua modules can only access statements placed on a given item, not statements pointing to it (or statements using a given property). It was promised ten years ago that eventually it would be possible – this was the so-called “phase 3” after interlanguage links (phase 1) and infobox data (phase 2) –, but apparently hasn’t happened (yet?). —Tacsipacsi (talk) 14:24, 19 November 2022 (UTC)[reply]
[edit]

I just created {{Wikipedia}} to link Wikipedia articles in the current page language via sitelinks by Wikidata Q identifier.

The template is powered by Wikidata Hub (Q63379538). I created it because I couldn't find such a template ... if something like this already exists, please tell me :)

--Push-f (talk) 12:23, 20 November 2022 (UTC)[reply]

Ok as it turns out that indeed already existed as {{Label}}, which accepts link=wikipedia. Resolving the sitelinks via Lua is even better than via Wikidata Hub (Q63379538) because it avoids an unnecessary HTTP redirect.
I still think {{Wikipedia|Q5}} is nicer to use than {{Label|Q5|link=wikipedia}}, so I am planning on updating my {{Wikipedia}} to just use Module:Wikidata_label#L-164 and have filed an edit request to make that function accessible. --Push-f (talk) 07:29, 23 November 2022 (UTC)[reply]

Userbox for this project

[edit]

I found it kinda ironic that of all the projects, this project didn't have a userbox template, so I created one:

This user is a member of
WikiProject Templates.

You can add it to your user page with {{User Templates}} :)

--Push-f (talk) 08:07, 21 November 2022 (UTC)[reply]

New query template: quickquery

[edit]

I created a new template for quickly writing and linking SPARQL queries ... I think it's quite neat.

Check it out at Template:Quickquery.

E.g. {{Quickquery|?item wdt:P31 wd:Q115268465}} becomes ?item wdt:instance of (P31) wd:Wikidata property to identify packages in a programming-language-specific registry (Q115268465).

Cheers, --Push-f (talk) 08:14, 21 November 2022 (UTC)[reply]

Template:Statement revamp

[edit]

I have rewritten the logic of {{Statement}} in Lua (Module:Statement) with the following benefits:

Cheers, --Push-f (talk) 08:41, 23 November 2022 (UTC)[reply]

I think we should merge Wikidata:WikiProject Templates/Exploring templates into Wikidata:Templates because the former is way more useful than the latter but the latter is our landing page for templates because Help:Templates redirects there (and I think that makes sense).

@PAC2: Pinging you since you created Wikidata:WikiProject Templates/Exploring templates ... what do you think of this idea?

Cheers, --Push-f (talk) 17:05, 25 November 2022 (UTC)[reply]

Yes, feel free to do it. It's a good idea. PAC2 (talk) 17:32, 26 November 2022 (UTC)[reply]

Done :) --Push-f (talk) 06:32, 28 November 2022 (UTC)[reply]