Template:Cast listing/doc: Difference between revisions

From HIBIKIFORUM
Jump to navigation Jump to search
mNo edit summary
 
(14 intermediate revisions by the same user not shown)
Line 1: Line 1:
{{Documentation subpage}}
{{Documentation subpage}}
{{Support|Template:Div col}}
{{Lua|Module:List}}
{{Support|Template:Col list}}
__NOTOC__


This template is for use in a cast list. It automatically breaks the available screen space into equal parts, meaning, for instance, that it is not necessary to guess how many columns to use and then figure out the dividing point(s), e.g., the halfway point to divide the list into two columns, or the one-third and two-thirds points to divide the list into three columns. The default value for the column width is {{code|30em}}, to change this value (in case names are too long and get pushed to the next line) use {{para|colwidth|#}}.
This template is for use in a cast list. It automatically breaks the available screen space into equal parts, meaning, for instance, that it is not necessary to guess how many columns to use and then figure out the dividing point(s), e.g., the halfway point to divide the list into two columns, or the one-third and two-thirds points to divide the list into three columns. The default value for the column width is {{code|30em}}, to change this value (in case names are too long and get pushed to the next line) use {{para|colwidth|#}}.
 
== Notice ==
This template uses [[Wikipedia:CSS|CSS]]3 multiple column layout and is not supported by all [[Wikipedia:WWW|Web]] [[Wikipedia:Web browser|browsers]].


== Usage ==
== Usage ==
This template uses [[Wikipedia:CSS|CSS]]3 multiple column layout and is not supported by all [[Wikipedia:WWW|Web]] [[Wikipedia:Web browser|browsers]].
{{tj|Cast listing
  | colwidth:  
  | Cast Name 1
  | Cast Name 2
  | Cast Name 3
  ...
  | Cast Name last
}}


=== Examples ===
== Examples ==
Here is an example:
{| style="width: 40%"
{{Pre|{{((}}{{fcb|#4169e1|<b>Cast Listing</b>}}|
|+ '''Example 1 - Normal Usage'''
* Me as myself
|- style="vertical-align:middle;"
* You as yourself
| style="width: 45%" |
* Her as herself
{{tj|Cast listing
* Him as himself
  | Me as myself
* Them as themselves
  | You as yourself
{{))}}}}
  | Her as herself
  | Him as himself
  | Them as themselves
}}
| style="text-align: center" | {{Rarr}}
|{{Cast listing
  | Me as myself
  | You as yourself
  | Her as herself
  | Him as himself
  | Them as themselves
}}
|}


which would render as:
{| style="width: 50%"
{{Cast Listing|
|+ '''Example 2 - Using {{para|colwidth}}'''
* Me as myself
|- style="vertical-align:middle;"
* You as yourself
| style="width: 45%" |
* Her as herself
{{tj|Cast listing|colwidth: 10
* Him as himself
  | Me as myself
* Them as themselves
  | You as yourself
  | Her as herself
  | Him as himself
  | Them as themselves
}}
}}
| style="text-align: center" | {{Rarr}}
|{{Cast listing|colwidth = 10
  | Me as myself
  | You as yourself
  | Her as herself
  | Him as himself
  | Them as themselves
}}
|}


An example using {{para|colwidth}}
{{clear}}
{{Pre|{{((}}{{fcb|#4169e1|Cast Listing}}|{{fcb|#4169e1|colwidth}}{{=}}{{font color|#933|15}}|
* Me as myself
* You as yourself
* Her as herself
* Him as himself
* Them as themselves
{{))}}}}


which would render as:
'''An example of a multiple story cast list'''
{{Cast Listing|colwidth=15|
{| style="width: 50%"
* Me as myself
|+ '''Must use {{tlb|blist}} for inside list'''
* You as yourself
|- style="vertical-align:middle;"
* Her as herself
| style="width: 45%" |
* Him as himself
{{{tcn|Cast listing}}
* Them as themselves
  <nowiki>|</nowiki> {{tcp|colwidth}} = {{tcv|20}}
  <nowiki>|</nowiki> <nowiki>'''Story 1 Name'''</nowiki>
  {{{{tcn|blist}}
    <nowiki>|</nowiki> {{tcv|Me as myself}}
    <nowiki>|</nowiki> {{tcv|You as yourself}}
    <nowiki>|</nowiki> {{tcv|Her as herself}}
    <nowiki>|</nowiki> {{tcv|Him as himself}}
    <nowiki>|</nowiki> {{tcv|Them as themselves}} }}
  <nowiki>|</nowiki> <nowiki>'''Story 2 Name'''</nowiki>
  {{{{tcn|blist}}
    <nowiki>|</nowiki> {{tcv|Me as myself}}
    <nowiki>|</nowiki> {{tcv|You as yourself}}
    <nowiki>|</nowiki> {{tcv|Her as herself}}
    <nowiki>|</nowiki> {{tcv|Him as himself}}
    <nowiki>|</nowiki> {{tcv|Them as themselves}} }}
}}
| style="text-align: center" | {{Rarr}}
|{{Cast listing
  | colwidth = 20
  | '''Story 1 Name'''
  {{blist
    | Me as myself
    | You as yourself
    | Her as herself
    | Him as himself
    | Them as themselves }}
  | '''Story 2 Name'''
  {{blist
    | Me as myself
    | You as yourself
    | Her as herself
    | Him as himself
    | Them as themselves }}
}}
}}
|}
== TemplateData ==
<templatedata>
{
"description": "Formats a list of voice actor role names into columns that automatically space for the given screen size.",
"params": {
"colwidth": {
"label": "Column Width",
"description": "To increase the width of the columns manually, so as to avoid names from breaking into multiple lines.",
"type": "number",
"default": "30",
"required": false
}
}
}
</templatedata>


<includeonly>{{sandbox other||{{testcases other||
<includeonly>{{sandbox other||{{testcases other||


<!-- Categories below this line, please -->
<!-- Categories below this line, please -->
[[Category:Templates]]
[[Category:CD page templates]]
[[Category:General Use Templates]]
[[Category:List templates]]
}}}}</includeonly>
}}}}</includeonly>

Latest revision as of 05:36, 20 August 2023

Light bulb.png }}
It contains usage information, categories and other content that is not part of the original template page.


This template is for use in a cast list. It automatically breaks the available screen space into equal parts, meaning, for instance, that it is not necessary to guess how many columns to use and then figure out the dividing point(s), e.g., the halfway point to divide the list into two columns, or the one-third and two-thirds points to divide the list into three columns. The default value for the column width is 30em, to change this value (in case names are too long and get pushed to the next line) use |colwidth=#.

Notice

This template uses CSS3 multiple column layout and is not supported by all Web browsers.

Usage

{{Cast listing
| colwidth =
| Cast Name 1
| Cast Name 2
| Cast Name 3 ...
| Cast Name last
}}

Examples

Example 1 - Normal Usage
{{Cast listing
| Me as myself
| You as yourself
| Her as herself
| Him as himself
| Them as themselves
}}
  • Me as myself
  • You as yourself
  • Her as herself
  • Him as himself
  • Them as themselves
Example 2 - Using |colwidth=
{{Cast listing
| colwidth = 10
| Me as myself
| You as yourself
| Her as herself
| Him as himself
| Them as themselves
}}
  • Me as myself
  • You as yourself
  • Her as herself
  • Him as himself
  • Them as themselves

An example of a multiple story cast list

Must use {{blist}} for inside list
{Cast listing
 | colwidth = 20
 | '''Story 1 Name'''
 {{blist
   | Me as myself
   | You as yourself
   | Her as herself
   | Him as himself
   | Them as themselves }}
 | '''Story 2 Name'''
 {{blist
   | Me as myself
   | You as yourself
   | Her as herself
   | Him as himself
   | Them as themselves }}
}}
  • Story 1 Name
    • Me as myself
    • You as yourself
    • Her as herself
    • Him as himself
    • Them as themselves
  • Story 2 Name
    • Me as myself
    • You as yourself
    • Her as herself
    • Him as himself
    • Them as themselves

TemplateData

Formats a list of voice actor role names into columns that automatically space for the given screen size.

Template parameters

ParameterDescriptionTypeStatus
Column Widthcolwidth

To increase the width of the columns manually, so as to avoid names from breaking into multiple lines.

Default
30
Numberoptional