English Français Deutsch

Home Features Demos Download Installation User Manual Developer Manual Credits

Login

Editor templates

Every page in Sofawiki can be edited as wikitext. As this method is very flexible, and you get quickly used to it. Sometimes, however, you want to give external users are more simple way to create pages, or you want to have consistent pages with all the same fields. Editor templates allow you to create quickly forms to create and edit pages that have always the same fields.

Install a new editor template

Editor templates must be added as link to the system message System:editortemplate.
The rest of the page can be defined freely with the following special templates you add with single curlies:

  • {name|default} for the name of the page to be created. This field must be present
  • {text|name|default} for text fields
  • {textarea|name|default} for long text fields
  • {options|name|default} for multiple choice check boxes
  • {radio|name|default} for exclusive radio buttons
  • {select|name|default} for exclusive pull down menus (functionally identical to radio buttons)
  • {sublang|lang|default} for sub language pages

See a sample Template:filmeditor

Using the editor

Once editor templates are defined, you will view them as a menu when you create a new article. Clicking the menu shows you the form you created with the editor template.

You can create new pages and edit existing pages. Sublanguage pages are created when necessary. Empty fields are removed.

Accessing the source of the article

The normal edit menu leads you to the editor template.

You can still access to the source wikitext with the edit source menu.

Limitations

With the editor template, you give up some flexibility:

  • You need to define one template to render the article
  • All content must be in fields. Text and fields you add in edit source mode will be lost. If there is some text or fields, a warning is shown.
  • The same can happen if you edit the editor template and remove some fields.
  • The sublanguage pages are automatically created and preceded by {}
  • Revisions are created for all sublanguage pages only when you change the text.
  • Changing the name does create a new version, it does not rename. There is no redirect to the new article.

Dynamic editor template:

  • The template is parsed before the field is added, so you can add some dynamic content based on the content of the article you are editing. However, you cannot plug in before the article is saved.