Feature summary
There should be a parser function for the content model of a page.
Suggestion: {{#contentmodel:}}.
A standard Wikitext page would return Wikitext. Other content types could not return the variable within the page itself, but this variable could be used in wikitext-based system messages; so a JavaScript page returns JavaScript, a CSS page returns CSS, etc. This info can be used to trigger switches.
This would not affect caching, given that content model changes are rare.
The way this has now been implemented is as follows:
- {{#contentmodel:canonical}} returns the canonical content model (in English)
- {{#contentmodel:local}} returns the local name of the content model.


