Template Documentation (sometimes hidden or invisible)
Template tools: purge • what links here • what transclude this • subpages |
This template uses Lua: |
Description[]
This template is used to make portrait galleries.
- Dependencies
This template uses File:NoPicAvailable.png.
For mobile support, it requires CSS defined here.
Syntax[]
The template works is to be called as follows:
{{Portrait Gallery |template= the name of the template |title= the title |colorscheme= the color scheme | portrait code | another portrait code | a third portrait code | etc. }}
The "portrait code" is peculiar. It consists of three parts, separated by backslashes ("\").
For example, Caesar \ Caesar Clown Marine Portrait.png \ Caesar Clown
is a portrait code.
- The first part is the text that is to be shown below the portrait.
- The second part is the name of the portrait picture (without link brackets or "File:"). It is optional: if it is not present, it is taken to be "XXX Portrait.png", with "XXX" being the text in the third part. Also, there is a special "NOPIC" value: it uses File:NoPicAvailable.png.
- The third part is the name of the page the portrait and text link to. It is optional: if it is not present, it is taken to be the same as the text (excluding parentheses). Also, there is a special "NOLINK" value, for cases when the portrait should not link to any page.
The title and colorscheme are self-explanatory. The template parameter should be given the name of the template page (warning: {{PAGENAME}}
does not work!); if present, it allows the gallery to feature template links on the left of the title.
Examples[]
The following code
{{Portrait Gallery |title=[[Alvida Pirates]] |cs=AlvidaPiratesColors |Alvida \ Fat Alvida Portrait.png |Koby (former) \ Koby Before Training Portrait.png |Heppoko |Peppoko |Poppoko }}
gives the following result:
An example with many different cases, with comments:
{{Portrait Gallery |title=People |cs=ArabastaColors |Pacifista <!-- only text; no pic and no link: the standard pic "XXX Portrait.png" is used, and the text is used as a link --> |Caesar Clown \ Caesar Marine Portrait.png <!-- only text and pic, no link: the text is used as a link --> |Koby (former) \ Koby Before Training Portrait.png <!-- only text and pic, no link: the text is used as a link, but the parentheses are ignored --> |Young Teach \ Marshall D. Teach Young Portrait.png \ Marshall D. Teach <!-- all three elements, with a link different than the text --> |??? \ Kuzan Pre Timeskip Portrait.png \ NOLINK <!-- use of the NOLINK special parameter; purpose should be clear --> |Marguerite \ NOPIC <!-- use of the NOPIC special parameter --> |Shanks' Father \ NOPIC \ NOLINK <!-- NOPIC + NOLINK --> }}
People | ||||
---|---|---|---|---|
An example with only one portrait:
{{Portrait Gallery |title=The Almighty Marguerite |colorscheme=KujaColors |Marguerite }}
The Almighty Marguerite | ||||
---|---|---|---|---|
Advanced Use[]
Colors[]
It is not always possible to use a colorscheme; to use custom colors, there are parameters textcolor and backcolor.
{{Portrait Gallery |title=The Almighty Marguerite |textcolor=FAEEAF |backcolor=012210 |Marguerite }}
The Almighty Marguerite | ||||
---|---|---|---|---|
Galleries with Sections[]
Sometimes, one needs to make sections in a portrait gallery. This can be done by joining several galleries together, thanks to the multi parameter.
- Use multi=header to start a gallery.
- Use multi=footer to end the gallery.
- Use section=XXX to create a middle section, with the title "XXX".
Here is an example of gallery with sections:
{{Portrait Gallery |multi=header |title=A Gallery with Sections |cs=AlvidaPiratesColors }} {{Portrait Gallery |section=Alvida Pirates |Alvida \ Fat Alvida Portrait.png |Koby (former) \ Koby Before Training Portrait.png |Heppoko |Peppoko |Poppoko }} {{Portrait Gallery |section=People |Pacifista |Caesar Clown \ Caesar Clown Marine Portrait.png |Koby (former) \ Koby Before Training Portrait.png |Young Teach \ Marshall D. Teach Young Portrait.png \ Marshall D. Teach |??? \ Kuzan Pre Timeskip Portrait.png \ NOLINK |Marguerite \ NOPIC |Shanks' Father \ NOPIC \ NOLINK }} {{Portrait Gallery |section=The Almighty Marguerite |Marguerite }} {{Portrait Gallery |multi=footer }}
A Gallery with Sections | ||||
---|---|---|---|---|
Alvida Pirates | ||||
People | ||||
The Almighty Marguerite | ||||
Galleries used as Sections in Other Galleries[]
Sometimes, galleries are used as sections in bigger galleries (such as in Template:Marines Gallery). To allow for a gallery to be included in another, one needs to add the following little code snippet: included={{{included|no}}}
. It must be added as a parameter. The following example is the code for Template:Macro Pirates Gallery:
{{Portrait Gallery|included={{{included|no}}} |title=[[Macro Pirates]] |cs=MacroPiratesColors |Macro |Gyaro |Tansui }}
Now we can include this template as a section in another gallery, using parameter included=yes:
{{Portrait Gallery |multi=header |title=A Gallery Including Another |cs=StrawHatPiratesColors }} {{Portrait Gallery |section=The Almighty Marguerite |Marguerite }} {{Macro Pirates Gallery|included=yes}} {{Portrait Gallery |section=Alvida Pirates |Alvida \ Fat Alvida Portrait.png |Koby (former) \ Koby Before Training Portrait.png |Heppoko \ Heppoko Portrait.png \ Heppoko, Peppoko, and Poppoko |Peppoko \ Peppoko Portrait.png \ Heppoko, Peppoko, and Poppoko |Poppoko \ Poppoko Portrait.png \ Heppoko, Peppoko, and Poppoko }} {{Portrait Gallery |multi=footer }}
A Gallery Including Another | ||||
---|---|---|---|---|
The Almighty Marguerite | ||||
Alvida Pirates | ||||
In order to do the same for galleries that already have several sections, add the snippet in both the header and footer. Here is a simple example:
{{Portrait Gallery|included={{{included|no}}} |multi=header |title=A Gallery with Sections, which Can Be Included Too |cs=FishmenColors }} {{Portrait Gallery |section=Alvida Pirates |Alvida \ Fat Alvida Portrait.png |Koby (former) \ Koby Before Training Portrait.png |Heppoko \ Heppoko Portrait.png \ Heppoko, Peppoko, and Poppoko |Peppoko \ Peppoko Portrait.png \ Heppoko, Peppoko, and Poppoko |Poppoko \ Poppoko Portrait.png \ Heppoko, Peppoko, and Poppoko }} {{Portrait Gallery |section=The Almighty Marguerite |Marguerite }} {{Portrait Gallery|included={{{included|no}}} |multi=footer }}
Putting this in "Template:Foobar Gallery", for example, we can include it in another gallery, exactly as a single-section template, by using {{Foobar Gallery|included=yes}}
.
Number of Columns[]
The default layout uses 5 columns. It is also possible to use a custom number of columns if needed, thanks to the cols parameter, which must be added to the header. Note that if there are less than 5 portraits in a gallery, leaving the default works anyway.
{{Portrait Gallery |multi=header |title=A Gallery using 3 Columns |cs=SabaodyColors |cols=3 }} {{Portrait Gallery |section=Alvida Pirates |Alvida \ Fat Alvida Portrait.png |Koby (former) \ Koby Before Training Portrait.png |Heppoko |Peppoko |Poppoko }} {{Portrait Gallery |section=People |Pacifista |Caesar Clown \ Caesar Clown Marine Portrait.png |Koby (former) \ Koby Before Training Portrait.png |Young Teach \ Marshall D. Teach Young Portrait.png \ Marshall D. Teach |??? \ Kuzan Pre Timeskip Portrait.png \ NOLINK |Marguerite \ NOPIC }} {{Portrait Gallery |multi=footer }}
A Gallery using 3 Columns | ||||
---|---|---|---|---|
Alvida Pirates | ||||
People | ||||
Number of Columns in Included Galleries[]
As of September 29 2024, this section is largely irrelevant. It only matters in the theoretical case of a gallery being included first (i.e. as the header). Galleries included as sections within another will conform to the number of columns like any other.
If a gallery is included in another gallery as the first element, the number of columns displayed can be modified using the icols
parameter. To use it, |icols = {{{icols|[default value]}}}
must be added in the gallery to be included, similar to the include
parameter defined above. The [default value]
can be set to any acceptable gallery column value, and will be used if the number of columns isn't specified in the gallery's inclusion in other templates.
To specify a custom number of columns, then, a value must be specified for icols
, same as any other parameter.
Visit Template:Portrait Gallery/doc to edit this text! (How does this work?) (Refresh this text - why?)