2

Is it it possible in MediaWiki to define a constant and then include the constant in other pages?

E.g. could MY_HELP_MESSAGE be defined as If you want help, contact help@somedomain… and MY_HELP_MESSAGE be called via e.g. {{MY_HELP_MESSAGE}} (as per https://meta.wikimedia.org/wiki/Help:Variable)?

3

Yes. Use vardefine.

#vardefine

    {{#vardefine:variablename|specifiedvalue}}

https://www.mediawiki.org/wiki/Extension:Variables

  • vardefine works within the same page. How do you define constants that can be referred to by more than one page? – oks Dec 13 '14 at 19:42

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.