Template:PageRef/doc: Difference between revisions

No edit summary
Sur (talk | contribs)
m no_file param prep
Line 31: Line 31:


Note: Instead of repeated use of <i>alt_file_name</i>, it is recommended to create a redirect at <nowiki>[[<first_parameter>.png]]</nowiki> to <nowiki>[[<alt_file_name>.png]]</nowiki>, allowing the use of the simplest form of PageRef, making it much easier to reference in the future.
Note: Instead of repeated use of <i>alt_file_name</i>, it is recommended to create a redirect at <nowiki>[[<first_parameter>.png]]</nowiki> to <nowiki>[[<alt_file_name>.png]]</nowiki>, allowing the use of the simplest form of PageRef, making it much easier to reference in the future.
If a file does not exist, it will look like
{{PageRef|My cool page}}
To not use the file, use:
<code><nowiki>{{PageRef|My cool page|no_file=true}}</nowiki></code>
{{PageRef|My cool page|no_file=true}}


=Parameters=
=Parameters=
<templatedata>
<templatedata>
{
{
Line 47: Line 53:
"type": "string"
"type": "string"
},
},
        "no_file": {
            "label": "Do not use file",
            "description": "Do not use any file; also use this parameter when a file doesn't exist. Note that passing 'false' does not make it use a file, the parameter must then be omitted. This is for code efficiency",
            "required": false,
            "example": "true",
            "type": "string"
        },
"alt_name": {
"alt_name": {
"label": "Alternate Name",
"label": "Alternate Name",