Toggle menu
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.

User:Chao: Difference between revisions

17,076 editsJoined 5 November 2017
mNo edit summary
(remove Master Gallery test code, add media categorization progress)
Line 1: Line 1:
<includeonly>{{#if:{{{3|}}}
== Media Categorization Progress ==
  |{{#vardefine:cat3 | [[Category:{{{3}}}]] }}
  |{{#vardefine:cat3 | }}
}}{{#ifeq: 0 | {{#var:{{{2}}} {{{3|}}}}}
|<!-- do nothing if no images -->
|{{#switch:{{{4}}}
    |h2=<h2>{{#if:{{{5|}}}|{{{5}}}|{{{2}}}}}</h2>
    |h3=<h3>{{#if:{{{5|}}}|{{{5}}}|{{{2}}}}}</h3>
  }}
  {{#ask:
    [[Category:{{{1}}}]]
    [[Category:{{{2}}}]]
    {{#var:cat3}}
    |?caption
    |format=gallery
    |autocaptions=no
    |captionproperty=?caption
    |perrow=7
  }}
}}</includeonly><noinclude>


{{TOC}}
* "search term" (filter for Files) -> Category
<!--
* '''Completed'''
-------------------------------
** "Lobby Avatar" -> [[:Category:Lobby Avatars]]
VARIABLES for TAGS/CATEGORIES
** "Normal Pose" -> [[:Category:Portraits]]
-------------------------------
** "Swimsuit Pose" -> [[:Category:Portraits]]
-->{{#vardefine:  MAIN_CAT|Main Artwork
** "Young Pose" -> [[:Category:Portraits]]
}}{{#vardefine: BATTLE_CAT|Battle
** "Crest" -> [[:Category:Crests]]
}}{{#vardefine: PALREF_CAT|Palette Reference
*** didn't know where to put Embryo so just left it tagged "Crests", no character tags
}}{{#vardefine: LOBAVI_CAT|Lobby Avatar
** "Chibi" -> [[:Category:Chibi]]
}}{{#vardefine:  CREST_CAT|Crest
** "Chibi.png" -> [[:Category:Chibi]]
}}{{#vardefine:  STORY_CAT|Story
* '''To Do'''
}}{{#vardefine:    CP_CAT|Chrono Phantasma
** "Story Mode Avatar" -> [[:Category:Portraits]]
}}<!--
** "Sprite Reference" -> [[:Category:Palette References]]
-------------------------------
** "Arcade" -> [[:Category:Arcade Mode]]
VARIABLES FOR IMAGE COUNTS
** "Birthday" -> [[:Category:Birthday Art]]
-------------------------------
** "Special" -> [[:Category:Special Artwork]]
-->{{#vardefine:{{#var:MAIN_CAT}}
** "Sticker" -> [[:Category:Stickers]]
  |{{#ask:[[Category:Kagura Mutsuki]][[Category:{{#var:MAIN_CAT}}]]|format=count}}
** "Wallpaper" -> [[:Category:Wallpapers]]
}}{{#vardefine:{{#var:BATTLE_CAT}}
** "Model Sheet" -> [[:Category:Model Sheets]]
  |{{#ask:[[Category:Kagura Mutsuki]][[Category:{{#var:BATTLE_CAT}}]]|format=count}}
** "Concept" -> [[:Category:Early Designs]]
}}{{#vardefine:{{#var:PALREF_CAT}}
** "Storyboard" -> [[:Category:Storyboards]]
  |{{#ask:[[Category:Kagura Mutsuki]][[Category:{{#var:PALREF_CAT}}]]|format=count}}
** "XBlaze Code Embryo Story"
}}{{#vardefine:{{#var:LOBAVI_CAT}}
** "XBlaze Lost Memories Story"
  |{{#ask:[[Category:Kagura Mutsuki]][[Category:{{#var:LOBAVI_CAT}}]]|format=count}}
** "XBlaze Lost Memories Ending"
}}{{#vardefine:Sprites
** "Chrono Phantasma Story Mode"
  |{{#expr:
** "Central Fiction Story Mode"
    {{#var:{{#var:BATTLE_CAT}}}} +
** "Clone Phantasma"
    {{#var:{{#var:PALREF_CAT}}}} +
    {{#var:{{#var:LOBAVI_CAT}}}}
  }}
}}{{#vardefine:{{#var:CREST_CAT}}
  |{{#ask:[[Category:Kagura Mutsuki]][[Category:{{#var:CREST_CAT}}]]|format=count}}
}}{{#vardefine:{{#var:CP_CAT}} {{#var:STORY_CAT}}
  |{{#ask:[[Category:Kagura Mutsuki]][[Category:{{#var:CP_CAT}}]][[Category:{{#var:STORY_CAT}}]]|format=count}}
}}<!--
-------------------------------
GALLERY LAYOUT
-------------------------------
--><!-- MAIN ARTWORK -->
{{ User:Chao | Kagura Mutsuki | {{#var:MAIN_CAT}} | | h2 }}
 
<!-- SPRITES -->
{{#ifeq: 0 | {{#var:Sprites}}
  | <!-- all three subcategories are empty, don't make a section header-->
  | <h2> Sprites </h2>
    {{ User:Chao | Kagura Mutsuki | {{#var:BATTLE_CAT}} | | h3 }}
    {{ User:Chao | Kagura Mutsuki | {{#var:PALREF_CAT}} | | h3 | Palette References }}
    {{ User:Chao | Kagura Mutsuki | {{#var:LOBAVI_CAT}} | | h3 | Lobby Avatars }}
}}
 
<!-- CHARACTER CREST -->
{{ User:Chao | Kagura Mutsuki | {{#var:CREST_CAT}} | | h2 | Character Crest }}
 
{{ User:Chao | Kagura Mutsuki | {{#var:CP_CAT}} | {{#var:STORY_CAT}} | h3 }}
 
== Technical Notes ==
 
=== Template: Gallery ===
 
Creates a gallery from template for the specified character. It will skip sections and subsections that the character does not have images for.
 
==== Template Usage ====
<syntaxhighlight>
  {{ Gallery | {{PAGENAME}} }}  <-- with the idea that {{PAGENAME}} will evaluate to ie. Kagura Mutsuki
OR {{ Gallery | Kagura Mutsuki }} <-- this will also work
</syntaxhighlight>
 
==== Template Code ====
<syntaxhighlight>
 
<!-- MAIN ARTWORK -->
{{ Gallery Section | {{{1}}} | Main Artwork | | h2 | Main Artwork }}
 
<!-- SPRITES -->
{{#ifeq: 0 | {{#var:Battle}} + {{#var:Palette Reference}} + {{#var:Third Category}}
  | <!-- all three subcategories are empty, don't make a section header-->
  | <h2> Sprites </h2>
    {{ Gallery Section | {{{1}}} | Battle | | h2 | Battle }}
    {{ Gallery Section | {{{1}}} | Palette Reference | | h3 | Palette Reference }}
    {{ Gallery Section | {{{1}}} | Portraits | | h2 | Portraits }}
}}
 
...
 
<!-- and so on with other categories and sub-categories -->
 
</syntaxhighlight>
 
=== Template: Gallery Section ===
 
Creates a section header with the specified depth (h2, h3, h4, h5), and a gallery of all images that contain the two specified tags. If there are no images in the specified gallery, this code will not do anything. (That is, it is safe to call even when "Kagura Mutsuki" does not have images in "XBlaze" -- an extraneous "XBlaze" header will not appear on Kagura's gallery page.)
 
==== Template Usage ====
<syntaxhighlight>
{{ Gallery Section
  | Kagura Mutsuki  <-- {{{1}}} Character name (Image category 1)
  | Main Artwork    <-- {{{2}}} Image Category 2
  |                <-- {{{3}}} Optional Image Category 3
  | h2              <-- {{{4}}} Header depth (h2, h3, h4, h5)
  | Main Artwork    <-- {{{5}}} Section header.
}}
 
ie. {{ Gallery Section | Kagura Mutsuki | Main Artwork | | h2 | Main Artwork }}
</syntaxhighlight>
 
==== Template Code ====
<syntaxhighlight>
{{#vardefine: {{{2}}} {{{3}}} |
  {{#ask:
    [[Category: {{{1}}} ]]
    [[Category: {{{2}}} ]]
    {{#if:{{{3|}}}
      | [[Category: {{{3}}} ]] | }}
    | format=count
  }}
}}{{#ifeq: 0 | {{#var: {{{2}}} {{{3}}} }} | <!-- do nothing if no images --> |
  {{#switch:{{{4}}}
    |h2=<h2>{{{5}}}</h2>
    |h3=<h3>{{{5}}}</h3>
  }}
  {{#ask:
    [[Category:{{{1}}}]]
    [[Category:{{{2}}}]]
    {{#if:{{{3|}}}
      | [[Category: {{{3}}} ]] | }}
    |?caption
    |format=gallery
    |autocaptions=no
    |captionproperty=?caption
    |perrow=7
    |overlay=yes
  }}
}}
</syntaxhighlight>
 
<hr>
<hr>
<hr>


== Useful References ==
== Useful References ==

Revision as of 21:11, 11 November 2017

Media Categorization Progress

Useful References

Modules

Semantic MediaWiki

DPL

Other things to look into later:

Note: I believe it"s good wikimedia practice to use only ==H2== and beyond (in essence, to avoid using =H1=)