Topic on Project:Support desk

Add a template to EVERY (even not created) page in a namespace?

6
VictorPorton (talkcontribs)

I want non-existent pages in certain namespace to show a hyperlink to an external site. I guess this can be done with templates.

But is it possible for all non-existent pages in a namespace to display a template? After all the page is non-existent, can it display anything?

I need this feature for default placeholders of yet empty namespace, which is to have too many entries (around 10000) to add a template to every entry manually.

I suspect MediaWiki does not support this. I know PHP, what can be done to implement this?

121.220.9.22 (talkcontribs)

Simply add the template to MediaWiki:Noarticletext.

{{#ifeq: {{NAMESPACE}} | Project | {{A template}} }}
VictorPorton (talkcontribs)

But can I also make this to appear in the textarea by default when somebody clicks "Create" button for the page in question?

I do not want this template to disappear when somebody edits the page.

87.123.44.133 (talkcontribs)

That is possible with a hook. You would have to check, which one, though.

VictorPorton (talkcontribs)
AhmadF.Cheema (talkcontribs)
Reply to "Add a template to EVERY (even not created) page in a namespace?"