Template:Menu/doc
This is a documentation subpage for Template:Menu. It contains usage information, categories, and other content that is not part of the original template page. |
This template uses TemplateStyles: |
Usage
editA logo may be specified in the |logo=
parameter. Below (or instead of) it appear the up to 99 rows specified in unnamed parameters. The width of the menu can be overridden in the |width=
parameter.
Internationalization
editIt is recommended to set the language of the menu content in the |lang=
parameter using a MediaWiki language code (en
, fr
, be-tarask
etc.). If set, this marks the menu content machine-readably to be in that language, and also sets the text direction of the menu content appropriately.
Optionally you can set the |dir=
parameter as well. It should be either ltr
or rtl
. It sets whether the menu floats to the left or the right, and also sets the text direction of the menu content if |lang=
isn’t set.
If |dir=
is not set, the menu floats to the left or the right depending on the page language (which is usually appropriate). If neither |lang=
nor |dir=
is set, the menu content is left-to-right (which is appropriate for English), but the content language isn’t set, which potentially causes issues with screen readers and machine translators or causes the text to appear using an inappropriate font.
Examples
edit{{menu |logo=[[File:Wikimedia-logo.svg|100px]] |<hr>[http://wikimediafoundation.org Official website] |{{menu/style|head}}[[Wikimedia committees|Committees]] |[[Chapters committee|Chapters]] |[[Communications committee|Communications]] |[[Events committee|Events]] |[[Fundraising committee|Fundraising]] |[[Special projects committee|Special projects]] |[[Trademarks committee|Trademarks]] }}
Note that the content of the menu is passed in numbered parameters 1 to N for each row (in this example they are not named). If you need to insert code that contains equal signs (for example HTML elements with attributes for style, language or direction), and if you don't want to maintain explicit numbers for each row, you must protect them within templates generating the item (you may also use {{=}} to generate an isolated equal sign without having to create a specific template for the item).
{{menu |dir=rtl |logo=[[File:Wikimedia-logo.svg|100px]] |<hr>[http://wikimediafoundation.org Official website] |{{menu/style|head}}[[Wikimedia committees|Committees]] |[[Chapters committee|Chapters]] |[[Communications committee|Communications]] |[[Events committee|Events]] |[[Fundraising committee|Fundraising]] |[[Special projects committee|Special projects]] |[[Trademarks committee|Trademarks]] }}