Module:Message box/doc/ja

Category:Module documentation pages/ja Category:Templates using TemplateStyles/ja

このメタモジュールは告知ボックス用テンプレート{{mbox}}、​{{ambox}}、​{{cmbox}}、​{{fmbox}}、​{{imbox}}、​{{ombox}} および {{tmbox}}を実行します。 Lua モジュール経由の利用を想定しており、ウィキページで直接使用できません。 ウィキページでこの機能を使いたい場合は、これではなく個別の告知用テンプレートを活用してください。

使用法

To use this module from another Lua module, first you need to load it.

local messageBox = require('Module:Message box')

To create a message box, use the main function. It takes two parameters:

  • the first is the box type (as a string).
  • the second is a table containing the message box parameters.
local box = messageBox.main( boxType, {
	param1 = param1,
	param2 = param2,
	-- More parameters...
})

There are seven available box types:

Box type テンプレート 目的
mbox {{mbox}} For message boxes to be used in multiple namespaces
ambox {{ambox}} For article message boxes
cmbox {{cmbox}} For category message boxes
fmbox {{fmbox}} For interface message boxes
imbox {{imbox}} For file namespace message boxes
tmbox {{tmbox}} For talk page message boxes
ombox {{ombox}} For message boxes in other namespaces

See the template page of each box type for the available parameters.

Usage from #invoke

As well as the main function, this module has separate functions for each box type.

They are accessed using the code {{#invoke:Message box|mbox|...}}, , etc.

These will work when called from other modules, but they access code used to process arguments passed from Script error: You must specify a function to call., and so calling them will be less efficient than calling main.

技術的な詳細

上記に示したそれぞれのテンプレートに対して、このモジュールは同一の基本コードを用います。それらの差異はModule:Message box/configurationのデータを用いて設定します。 Category:Module documentation pages/ja

Category:Module documentation pages/ja Category:Pages using the JsonConfig extension Category:Templates using TemplateStyles/ja