How to specify a default content in the text editor on MediaWiki page creation?

On a MediaWiki, I would like that when someone creates a new page, the content of the text editor is automatically set to a certain value. For instance when one creates a new page called MyPage, the content of the text editor would be:

Please modify this content and then click on the 'save' button.

I can't find a system message that does what I want.

Then, how to make this behavior depend on the namespace of the page? For instance, I want this default value to appear only when the created page belongs to custom namespace Foo.

Upvotes: 1

Views: 217

Answers (2)

Thanks Nemo, but I think I found another answer that really fitted my needs: in the mediawiki extension I developed, I used the hook named EditFormPreloadText http://www.mediawiki.org/wiki/Manual:Hooks/EditFormPreloadText To edit the text on creation of a new page. I specialized it so that it acts only for the specific namespace the extension defines.

Upvotes: 1

Nemo
Nemo

Reputation: 2544

Have you tried preload? You could probably alter the red links (a tags with "new" class) via JavaScript.

If you only want to add a notice, not real content, you instead have to use edit notices. That's a system message and is designed to be used that way.

If you want users to follow some specific format, perhaps you should use actual forms, via SemanticForms. Forms can also be loaded by default depending on various conditions.

Upvotes: 0

Related Questions