Template:IMDb name: Difference between revisions

From Zoophilia Wiki
Jump to navigationJump to search
meta>WOSlinker
fix padding to work when id length >= 7
meta>Zyxw
Add fix to length check so article using new IMDb ID (nm followed by 8 digits) is not added to Category:IMDb template with invalid id set. Display a preview-only warning message if ID has invalid length, so it might be fixed before saving (also allows for testing in /testcases). Tested changes with /sandbox.
Line 20: Line 20:
   | {{Main other|[[Category:IMDb template with no id set]]}}
   | {{Main other|[[Category:IMDb template with no id set]]}}
   }}{{#ifeq: {{Str left|{{{1|{{{id}}}}}}|2}} | nm
   }}{{#ifeq: {{Str left|{{{1|{{{id}}}}}}|2}} | nm
   | {{#ifeq: {{Str len|{{{1|{{{id}}}}}}}} | 9
   | {{#ifexpr: {{Str len|{{{1|{{{id}}}}}}}} < 9 or {{Str len|{{{1|{{{id}}}}}}}} > 10
     |
    | {{Main other|[[Category:IMDb template with invalid id set]]}}{{#invoke:Preview warning|main|IMDb ID starting with ''nm'' should be followed by seven or eight digits, such as ''nm0000567'' or ''nm12345678''}}
     | {{Main other|[[Category:IMDb template with invalid id set]]}}
     }}
  | {{#ifexpr: {{Str len|{{{1|{{{id}}}}}}}} > 8
     | {{Main other|[[Category:IMDb template with invalid id set]]}}{{#invoke:Preview warning|main|IMDb ID should not contain more than eight digits}}
     }}
     }}
   }}</includeonly><noinclude>
   }}</includeonly><noinclude>
{{documentation}}
{{documentation}}
</noinclude>
</noinclude>

Revision as of 08:07, 25 March 2019

IMDb name on IMDb