Template:KeitaArea: Difference between revisions

From Pokemon Revolution Online Wiki
Jump to navigation Jump to search
No edit summary
No edit summary
 
(3 intermediate revisions by the same user not shown)
Line 1: Line 1:
<includeonly>
<noinclude>
   <body>
This template tabulates all basic area data.
    <div class="infobox">
Usage: {{AreaInfoBox
      <div class="infobox-header">
| Type =
        {{{Name|{{PAGENAME}}}}} - {{{Region|Unknown}}}
| Region =
| Maps =
| Location =
| Badge =
| Leader =
| GymType =
| BattleNPCs =
| Items =
| BerryTrees =
| North =
| West =
| South =
| East =
}}
</noinclude><includeonly>{{!
MUTE TEMPLATESTYLES}}{{!
-- Logic and Variable Definitions First --
}}{{#vardefine:location|{{#ifexist:File:{{PAGENAME}}.gif|{{PAGENAME}}|{{{Location|}}}}}}}{{!
-- Main Container --
}}{{#tag:div|
 
   {{#if:{{{Maps|}}}
    | <div class="keita-infobox-section">
        <h2 class="keita-infobox-section-title">Overview Collage</h2>
        <div class="keita-infobox-gallery">
          {{#loop: map | {{#explode:{{{Maps}}}|,}} |
            <div class="keita-infobox-gallery-item">
              [[File:{{#var:map}}.png|100px|link={{#var:map}}]]
              <span>{{#var:map}}</span>
            </div>
          }}
        </div>
      </div>
    | <div class="keita-infobox-section">
        <h2 class="keita-infobox-section-title">Overview</h2>
        [[File:{{PAGENAME}}.png|400px]]
       </div>
       </div>
      <div class="infobox-content">
  }}
<!-- Map section - handles both single and multiple maps -->
 
{{#if:{{{Maps|}}} |  
  {{#if:{{#var:location}} |
  <!-- Multiple maps display when Maps parameter is provided -->
    <div class="keita-infobox-section">
  <div class="multiple-maps">
      <h2 class="keita-infobox-section-title">Location</h2>
    <p class="maps-title">Area Maps</p>
       [[File:{{#var:location}}.gif|200px]]
    <div class="maps-grid">
      <p class="keita-infobox-caption">A positional vantage point of {{PAGENAME}} in {{{Region}}}.</p>
      <!-- Define array from Maps parameter -->
       {{#arraydefine:mapArray|{{{Maps}}}}}
     
      <!-- Loop through each map in the array -->
      {{#loop: i | 1 | {{#arraysize:mapArray}} |
        <!-- Calculate 0-based index -->
        {{#vardefine:index|{{#expr:{{#var:i}} - 1}}}}
       
        <!-- Create div for each map -->
        <div class="map-item">
          [[File:{{#arrayindex:mapArray|{{#var:index}}}}.png|200px|alt={{#arrayindex:mapArray|{{#var:index}}}}|class=map-thumbnail]]
          <p class="map-caption">{{#arrayindex:mapArray|{{#var:index}}}}</p>
        </div>
      }}
     </div>
     </div>
   </div>
   }}
|
 
  <!-- Single map display when Map parameter is provided, or default to page name -->
   {{#if:{{{Badge|}}} |
   {{#if:{{{Map|}}} |
     <div class="keita-infobox-section">
     <div class="single-map">
       <h2 class="keita-infobox-section-title">[[File:{{{Badge}}}_Badge_Icon.png|30px]] {{PAGENAME}} Gym</h2>
       <p class="map-title">Area Map</p>
      <table class="keita-info-rows">
      [[File:{{{Map}}}.png|400px|alt={{{Name|{{PAGENAME}}}}} Map|class=map-image]]
        <tr>
    </div>
          <th>Gym Leader</th>
  |
          <td>{{{Leader}}}</td>
    <!-- Default map (uses page name as filename) -->
        </tr>
    <div class="single-map">
        <tr>
      <p class="map-title">Area Map</p>
          <th>Type Specialty</th>
      [[File:{{PAGENAME}}.png|400px|alt={{PAGENAME}} Map|class=map-image]]
          <td>[[{{{GymType}}}_(type)|{{{GymType}}}]]</td>
        </tr>
        <tr>
          <th>Badge</th>
          <td>{{{Badge}}} Badge</td>
        </tr>
      </table>
     </div>
     </div>
   }}
   }}
}}
 
        <div class="minimap-area">
  {{#ifexpr: {{{Items|0}}} + {{{BerryTrees|0}}} + {{{BattleNPCs|0}}} > 0 |
          <p class="MinimapLocation">Minimap Location</p>
    <div class="keita-infobox-section">
          [[File:{{{Minimap}}}.gif|200px|alt={{{Name|{{PAGENAME}}}}}
      <h2 class="keita-infobox-section-title">Resources</h2>
           Minimap|class=map-image minimap]]
      <table class="keita-info-rows">
        </div>
        {{#if:{{{BattleNPCs|}}}|
          <tr>
            <th>Battleable NPCs</th>
            <td>{{{BattleNPCs}}}</td>
           </tr>
         }}
         }}
        <hr />
         {{#if:{{{Items|}}}|
        <!-- Gym section, shown only if Badge is provided -->
           <tr>
         {{#if: {{{Badge|}}} |
             <th>Ground Items</th>
        <div class="infobox-section">
            <td>{{{Items}}}</td>
           <h3>{{{Name|{{PAGENAME}}}}} Gym</h3>
          </tr>
          <div class="infoxbox_table_container">
             <table>
              <tr>
                <td>Gym-leader</td>
                <td>{{{GymLeader|Unknown}}}</td>
              </tr>
              <tr>
                <td>Type</td>
                <td>[[{{{GymType|Unknown}}}_(type)|{{{GymType|Unknown}}}]]</td>
              </tr>
              <tr>
                <td>Badge</td>
                <td>{{{Badge|Unknown}}}</td>
              </tr>
            </table>
          </div>
        </div>
         }}
         }}
        <!-- Resources section, shown only if NPCs, Items, or BerryTrees > 0 -->
         {{#if:{{{BerryTrees|}}}|
         {{#vardefine:resources|{{#expr:{{{NPCs|0}}}+{{{Items|0}}}+{{{BerryTrees|0}}}}}}}
           <tr>
        {{#ifexpr: {{#var:resources}} > 0 |
             <th>Berry Trees</th>
        <div class="infobox-section">
            <td>{{{BerryTrees}}}</td>
           <h3>Resources</h3>
          </tr>
          <div class="infoxbox_table_container">
             <table>
              <tr>
                <td>Battle NPCs</td>
                <td>{{{NPCs|0}}}</td>
              </tr>
              <tr>
                <td>Ground Items</td>
                <td>{{{Items|0}}}</td>
              </tr>
              <tr>
                <td>Berry Trees</td>
                <td>{{{BerryTrees|0}}}</td>
              </tr>
            </table>
          </div>
        </div>
        }} {{#if: {{{North|}}} {{{East|}}} {{{West|}}} {{{South|}}} |
        <div class="infobox-section">
          <h3>Adjacent areas</h3>
        </div>
        <div class="center-grid-keita">
          <div class="grid-keita">
            <!-- North box: always shown, with placeholder if no map -->
            <div class="north box">
              {{#if: {{{North|}}} | [[{{{North}}}]] | /// }}
            </div>
            <!-- West box: always shown, with placeholder if no map -->
            <div class="west box">
              {{#if: {{{West|}}} | [[{{{West}}}]] | /// }}
            </div>
            <!-- Central plus sign -->
            <div class="plus">[[File:Arrow.webp|20px|link=|alt=Arrow]]</div>
            <!-- East box: always shown, with placeholder if no map -->
            <div class="east box">
              {{#if: {{{East|}}} | [[{{{East}}}]] | /// }}
            </div>
            <!-- South box: always shown, with placeholder if no map -->
            <div class="south box">
              {{#if: {{{South|}}} | [[{{{South}}}]] | /// }}
            </div>
          </div>
        </div>
         }}
         }}
      </table>
    </div>
  }}
  {{#if: {{{North|}}}{{{West|}}}{{{South|}}}{{{East|}}} |
    <div class="keita-infobox-section">
      <h2 class="keita-infobox-section-title">Adjacent Areas</h2>
      <div class="keita-infobox-adjacency">
        <div class="keita-adj-north">{{#if:{{{North|}}}|[[{{{North}}}|↑<br />{{{North}}}]]}}</div>
        <div class="keita-adj-west">{{#if:{{{West|}}}|[[{{{West}}}|← {{{West}}}]]}}</div>
        <div class="keita-adj-center">{{PAGENAME}}</div>
        <div class="keita-adj-east">{{#if:{{{East|}}}|[[{{{East}}}|{{{East}}} →]]}}</div>
        <div class="keita-adj-south">{{#if:{{{South|}}}|[[{{{South}}}|{{{South}}}<br />↓]]}}</div>
       </div>
       </div>
     </div>
     </div>
    <!-- Categories -->
  }}
    [[Category:Locations]] {{#if: {{{Region|}}} | [[Category:{{{Region}}}
 
    areas]]}} {{#if: {{{Badge|}}} | [[Category:Gyms]]}}
| class=keita-area-infobox, style=--color-border: #${{{Type}}}_color_dark}; --color-background: #${{{Type}}}_color}; --color-cell: #${{{Type}}}_color_light}; , data-type={{{Type}}} }}
  </body>
<div class="keita-area-infobox-header" style="--color-border: #${{{Type}}}_color_dark}; --color-cell: #${{{Type}}}_color_light};">
  {{PAGENAME}} - [[{{{Region}}}|<span style="color:var(--color-border);">{{{Region}}}</span>]]
</div>
 
[[Category:Locations]]
{{#if:{{{Region|}}}|[[Category:{{{Region}}} areas]]}}
{{#switch: {{ucfirst:{{{Type}}}}}|Cave=[[Category:Caves]]|Mountain=[[Category:Mountains]]|Forest=[[Category:Forests]]|Lake=[[Category:Lakes]]|#default=}}
{{#if:{{{Badge|}}}|[[Category:Gyms]]}}
<templatestyles src="Template:AreaInfoBox/styles.css" />
</includeonly>
</includeonly>

Latest revision as of 22:57, 29 September 2025

This template tabulates all basic area data. Usage: Template:AreaInfoBox