I'm on MW 1.28 and sometimes need to store page IDs in the source code of the page.
Substitution ({{subst:PAGEID}}) works fine if the page already exists, but 'comes up empty' when a new page is created.
I'm on MW 1.28 and sometimes need to store page IDs in the source code of the page.
Substitution ({{subst:PAGEID}}) works fine if the page already exists, but 'comes up empty' when a new page is created.
This is documented in Help:Magic words#Technical metadata of another page:
When the given param is equal to the current title of the parser, the parser function will yield the previous versions on preview and on substitution, that includes empty strings when used on page creation but using the values from the current version for page view, including viewing old revisions. In this case it is a non-expensive parser function.