Module best practices

Edit | Tags | Source | Print

Posted 1250103151|%O ago by pieterhpieterh
This page lists practices which some of the more recent modules apply, which we'd like to see used everywhere.

URL arguments

All arguments can be passed in the URL by appending "/name=value" to the URL used to invoke the page and by specifying argument="@URL" in the module.

Minimal verbosity

Modules should not generate surrounding page content, this is up to the template designer. Historically, modules did this heavily (e.g. forum modules), and this is carried over into (e.g.) Comments, which generates a H2 title and then allows users to disable this. It should not produce any title, ever, nor text such as "Add your comment".

Inline use

(New) We want to be able to use all modules inline, using the syntax [[inline ModuleName...]]. Inlined modules do not output a division, are not block elements. Not yet sure if they can contain template code or not (wiki text between tags).

Add a New Comment