Module talk:WikidataIB/Archive 7: Difference between revisions

Content deleted Content added
m Archiving 1 discussion(s) from Module talk:WikidataIB) (bot
m Archiving 2 discussion(s) from Module talk:WikidataIB) (bot
Line 144:
:I am not sure if all of those are directly transcluded invocations or not. I would start with a source search like {{sl|insource:/FETCH_WIKIDATA/|searching template source for "FETCH_WIKIDATA"|ns10|limit=500}} ([[Module:Wikidata]] seems to be the only thing that uses the "FETCH_WIKIDATA" sentinel value; after we get rid of those we can look harder for every transcluded invocation) instead of [[Special:WhatLinksHere/Module:Wikidata]]. There is also some more useful information at [[Module talk:Wikidata#Porting Guide]]. —[[User:Uzume|Uzume]] ([[User talk:Uzume|talk]]) 15:31, 13 September 2020 (UTC)
::I am not sure either, hence my disclaimers above, but they are easy to check by looking at the template code. Infobox AFL biography, for example, contains "invoke:Wikidata|claim|P18" in its template code. The search result linked above contains 100 infobox templates (excluding sandboxes) and overlaps pretty well with the list I made above. If you want to add to the list above, please do so. If you find that a template in the list above does not need modification, feel free to strike it out, as I have done with Infobox Tibetan Buddhist monastery. – [[User:Jonesey95|Jonesey95]] ([[User talk:Jonesey95|talk]]) 15:46, 13 September 2020 (UTC)
 
== Uppercase first letter ==
 
Is there an easy way to make the first character uppercase (which is the usual format for parameters in an infobox) apart from stripping off the icon and using the ''ucfirst'' magic word? &mdash;&nbsp;Martin <small>([[User:MSGJ|MSGJ]]&nbsp;·&nbsp;[[User talk:MSGJ|talk]])</small> 13:41, 23 September 2020 (UTC)
:Instead of the magic word, you could try [[Module:WikidataIB#Coding_into_an_infobox|this]]. [[User:Rehman|<span style="font-variant:small-caps; font-weight:bold; color:darkblue">Reh</span>]][[User talk:Rehman|<span style="color:green">man</span>]] 15:24, 23 September 2020 (UTC)
::Perfect, thank you &mdash;&nbsp;Martin <small>([[User:MSGJ|MSGJ]]&nbsp;·&nbsp;[[User talk:MSGJ|talk]])</small> 15:58, 23 September 2020 (UTC)
 
== Convert units ==
 
I know {{tl|convert}} contains from clever functions to get quantities from wikidata and convert them. I wondered if it possible to use this module, so that the parameters {{para|fwd}} and {{para|osd}} can be used to match the other fields in the infobox. But I don't if/how I can put the output of this module through the convert template. Any advice please? &mdash;&nbsp;Martin <small>([[User:MSGJ|MSGJ]]&nbsp;·&nbsp;[[User talk:MSGJ|talk]])</small> 13:29, 23 September 2020 (UTC)
:Have you looked at the (extensive!) documentation for [[:Module:Wikidata]] or [[:Module:Wd]]? Do a Find for "unit" on those pages. – [[User:Jonesey95|Jonesey95]] ([[User talk:Jonesey95|talk]]) 15:20, 23 September 2020 (UTC)
:: {{re|MSGJ|label=Martin}} If you want to stick with WikidataIB, you can use the {{para|convert}} parameter (alias <code>conv</code>) which pipes the output directly through [[Template:Cvt]]:
::* for {{q|Q940078}}, {{q|P2043}}
::* <code><nowiki>{{#invoke:WikidataIB |getValue |P2043 |qid=Q940078 |fwd=ALL |osd=n |conv=y}}</nowiki></code> → {{#invoke:WikidataIB |getValue |P2043 |qid=Q940078 |fwd=ALL |osd=n |conv=y}}
:: It's documented at [[Module:WikidataIB #Parameters to getValue]]. Hope that helps. --[[User:RexxS|RexxS]] ([[User talk:RexxS|talk]]) 16:47, 23 September 2020 (UTC)
:::That's just what I'm looking for, thanks. I looked through that table twice so no idea why I didn't spot that option. &mdash;&nbsp;Martin <small>([[User:MSGJ|MSGJ]]&nbsp;·&nbsp;[[User talk:MSGJ|talk]])</small> 17:50, 23 September 2020 (UTC)