Module:Main page image/doc: Difference between revisions
Appearance
Content deleted Content added
ce |
remove file prefix |
||
Line 4: | Line 4: | ||
<code><nowiki>{{</nowiki>#invoke:{{BASEPAGENAME}}|width|''ImageTitle''}}</code> Get image width from ImageTitle. |
<code><nowiki>{{</nowiki>#invoke:{{BASEPAGENAME}}|width|''ImageTitle''}}</code> Get image width from ImageTitle. |
||
''ImageTitle'' must not contain the namespace prefix (eg "File:"). You can use {{t|Remove file prefix}} to strip it, if it exists, when sanitising template params. Example: <code><nowiki>{{#invoke:Main page image|width|{{Remove file prefix|{{{image}}}}}}}</nowiki></code> |
|||
<includeonly>{{#ifeq:{{SUBPAGENAME}}|sandbox | | |
<includeonly>{{#ifeq:{{SUBPAGENAME}}|sandbox | | |
Revision as of 21:22, 31 July 2020
This module provides utility for wrappers of {{Main page image}}.
Usage
{{#invoke:Main page image|width|ImageTitle}}
Get image width from ImageTitle.
ImageTitle must not contain the namespace prefix (eg "File:"). You can use {{Remove file prefix}} to strip it, if it exists, when sanitising template params. Example: {{#invoke:Main page image|width|{{Remove file prefix|{{{image}}}}}}}