မေႃႇၵျူး:unsubst/doc
This is the documentation page for မေႃႇၵျူး:unsubst
This module protects templates and modules from being wrongly substituted.
လွင်ႈၸႂ်ႉတိုဝ်း
မႄးထတ်းThere are two ways to use this module:
- Protecting all templates in a module
First, put the following at the top of a module which contains functions designed to be called by {{[[ထႅမ်းပလဵၵ်ႉ:#invoke:|#invoke:]]}}:
-- Prevent substitution. if mw.isSubsting() then return require("Module:unsubst") end
Second, edit each template which calls that module from:
- {{[[ထႅမ်းပလဵၵ်ႉ:#invoke:...|#invoke:...]]}}
to:
Note: this should only be used with modules that only return functions which are designed to be called by templates (not by other modules). If your module also returns functions (or other data) designed to be called by other modules, then the safest solution is to separate out the template functions into a separate module, usually in the format Module:.../templates
(e.g. Module:links/templates). This is because unsubst prevents any functions or data in a module from being accessed during substitution, which will disrupt other modules which need to access your module while they are being substituted.
- In templates
Template code can be wrapped as follows:
{{[[ထႅမ်းပလဵၵ်ႉ:safesubst:<noinclude/>
#invoke:unsubst|safesubst:<noinclude/>
#invoke:unsubst]]}}
Lua error in မေႃႇၵျူး:module_categorization at line 173: This template should only be used in the Module namespace, not on page 'မေႃႇၵျူး:unsubst/doc'..