Difference between revisions of "Template:Commons-inline/sandbox"

From blackwiki
Jump to navigation Jump to search
imported>Hike395
(if list, don't fetch from wikidata)
imported>Hike395
m (missed brackets)
Line 2: Line 2:
 
   -->|links={{#if:{{{links|}}}|{{{links}}}|<!--         
 
   -->|links={{#if:{{{links|}}}|{{{links}}}|<!--         
 
       -->[[commons:{{if then show|{{{1|}}}|<!--
 
       -->[[commons:{{if then show|{{{1|}}}|<!--
                     -->{{if then show|{{WikidataOI|property|{{{qid|}}}|P935|fetch={{is empty|{{{list|}}}}}|<!--
+
                     -->{{if then show|{{WikidataOI|property|{{{qid|}}}|P935|fetch={{is empty|{{{list|}}}}}}}|<!--
                       -->{{if then show|{{WikidataOI|property|{{{qid|}}}|P373|fetch={{is empty|{{{list|}}}}}|<!--
+
                       -->{{if then show|{{WikidataOI|property|{{{qid|}}}|P373|fetch={{is empty|{{{list|}}}}}}}|<!--
 
                         -->Special:Search/{{PAGENAME}}|Category:}}}}}}<!--
 
                         -->Special:Search/{{PAGENAME}}|Category:}}}}}}<!--
 
       -->|{{if empty|{{{2|}}}|{{{1|}}}|{{PAGENAME}}}}]]}}<!--
 
       -->|{{if empty|{{{2|}}}|{{{1|}}}|{{PAGENAME}}}}]]}}<!--
 
   -->|extratext={{{extratext|}}}}}<noinclude>
 
   -->|extratext={{{extratext|}}}}}<noinclude>
 
{{Documentation}}</noinclude>
 
{{Documentation}}</noinclude>

Revision as of 04:18, 4 January 2020

16x16px Media related to [[commons:Template:WikidataOI|Script error: No such module "If empty".]] at Wikimedia Commons

50px Template documentation[view] [edit] [history] [purge]

Usage

{{Commons-inline|Commons-gallery-page-name}}

Commons gallery page name is optional: if missing, template will look up associated gallery in wikidata. If that's missing, will find associated category. If that's missing, will fall back to Commons search.

Full syntax
{{Commons-inline
|list=                       wikitext for a list 
|links=                      wikitext to override default link 
|Commons-gallery-page-name= 
|extratext=                  extra text 
|search=                     string to search in Commons
|notrack=                    turn off tracking categories
}}

Examples

Normal
{{Commons-inline|Work}}

16x16px Media related to Work at Wikimedia Commons

Text override

Work is the link target and Puffle is the link label.

{{Commons-inline|Work|Puffle}}

16x16px Media related to Puffle at Wikimedia Commons

Full link override
{{Commons-inline|links=[[commons:Foo|]] and [[commons:Bar|]]}}

16x16px Media related to Foo and Bar at Wikimedia Commons

List format
{{Commons-inline|list=
* [[commons:Foo|Foo]]
* [[commons:Bar|Bar]]
* [[commons:Row|Row]]
* [[commons:Dee|Dee]]
}}

16x16px Related media at Wikimedia Commons:

Another list format, including Commons templates
{{Commons-inline|list=
:[[c:Commons:Timed Text|Commons:Timed Text]]
:{{[[Commons:Template:Captions requested|Captions requested]]}}
}}

16x16px Related media at Wikimedia Commons:

Commons:Timed Text
{{Captions requested}}
Extra text
{{Commons-inline|Work|extratext= Extra text}}

16x16px Media related to Work at Wikimedia Commons Extra text

Force Commons search
{{Commons-inline|search=Work}}

16x16px Media related to Work at Wikimedia Commons

Turn off tracking categories (for use inside other templates)
{{Commons-inline|Work|notrack=1}}

16x16px Media related to Work at Wikimedia Commons

See also