Template:CaeLandData: Difference between revisions

From Pokemon Revolution Online Wiki
Jump to navigation Jump to search
Cae (talk | contribs)
created test template
 
Cae (talk | contribs)
No edit summary
 
(2 intermediate revisions by the same user not shown)
Line 1: Line 1:
<noinclude>[[Category:Pokémon-location templates]]</noinclude>
<noinclude>[[Category:Pokémon-location templates]]</noinclude>
<includeonly><style>
<includeonly>
.pokemon-spawn-table {
{{Trichrome|Color={{{Color|{{#var:primaryType}}}}}}}
  width: 85%;
  max-width: 90%;
  text-align: center;
  margin: auto auto;
  border-radius: 15px;
  border: 3px solid {{#var:border}};
  background-color: {{#var:background}};
  padding: 7px;
}


.pokemon-spawn-table thead th {
<!-- Store the result of the data query in a variable -->
  background-color: {{#var:cell}};
{{#get_file_data:source=spawns|file name=land_spawns.csv|format=CSV with header|filters=Pokemon={{{Name|{{PAGENAME}}}}}|data=area=Map,member=Member,number=DexID,name=Pokemon,morning=Morning,day=Day,night=Night,item=Item,rarity=Tier,minlvl=MinLvl,maxlvl=MaxLvl|store=spawnData}}
  color: {{#var:border}};
  border: 1px solid {{#var:border}};
}
 
.pokemon-spawn-table thead th:first-child {
  border-top-left-radius: 25px;
}
.pokemon-spawn-table thead th:last-child {
  border-top-right-radius: 25px;
}
 
.pokemon-spawn-footer {
  text-align: left;
  border-radius: 1px 1px 25px 25px;
  border: 1px solid {{#var:border}};
  background-color: {{#var:cell}};
  padding: 10px;
  margin-top: 8px;
}
 
.pokemon-spawn-note span {
  color: #FF00BF;
  font-weight: bold;
}
</style>
 
{{#vardefine:spawn_count|{{#get_file_data:
  source=spawns
  |file name=land_spawns.csv
  |format=CSV with header
  |filters=Pokemon={{{Name|{{PAGENAME}}}}}
  |data=area=Map, member=Member, number=DexID, name=Pokemon,
        morning=Morning, day=Day, night=Night,
        item=Item, rarity=Tier, minlvl=MinLvl, maxlvl=MaxLvl
  |count
}}}}
 
{{#vardefine:debug|{{#var:spawn_count}}}}
 
<!-- Debug: Print the spawn count -->
<p>Spawn count: {{#var:debug}}</p>
 
{{#if: {{#var:spawn_count}} > 0
| <!-- If data is found -->
  {{Trichrome|Color={{{Color|{{#var:primaryType}}}}}}}
 
  <table class="pokemon-spawn-table">
    <thead>
      <tr>
        <th style="width: 15%;">Location</th>
        <th style="width: 7%;">Levels</th>
        <th colspan="3" style="width: 17%;">
          [[Pokétime|<span>Times</span>]]
        </th>
        <th style="width: 20%;">Held Item</th>
        <th style="width: 10%;"><span>Rarity Tier</span></th>
      </tr>
    </thead>


<!-- Check if spawnData contains actual data -->
{{#if: {{{spawnData|}}}
  <!-- If data found, display the table -->
  <table align="left" style="width: 85%; max-width: 90%; text-align: center; cellpadding: 3px; cellspacing: 10px; margin: auto auto; border-radius: 15px; border: 3px solid {{#var:border}}; background-color: {{#var:background}}; padding: 7px;">
    <tr style="background-color: {{#var:cell}}; color: {{#var:border}};">
      <th scope="col" style="border-top-left-radius: 25px; width: 15%; border: 1px solid {{#var:border}};">Location</th>
      <th scope="col" style="width: 7%; border: 1px solid {{#var:border}};">Levels</th>
      <th colspan="3" scope="col" style="width: 17%; border: 1px solid {{#var:border}};">[[Pokétime|<span style="color: {{#var:border}};">Times</span>]]</th>
      <th style="width: 20%; border: 1px solid {{#var:border}};">Held Item</th>
      <th style="border-top-right-radius: 25px; width: 10%; border: 1px solid {{#var:border}};">[[List of Pokémon by Rarity Tier|<span style="color: {{#var:border}};">Rarity Tier</span>]]</th>
    </tr>
     {{#display_external_table:
     {{#display_external_table:
       template=PokemonLandDataRow
       template=PokemonLandDataRow|data=area=area,member=member,number=number,name=name,morning=morning,day=day,night=night,item=item,rarity=rarity,minlvl=minlvl,maxlvl=maxlvl
      |data=area=area, member=member, number=number, name=name,
            morning=morning, day=day, night=night,
            item=item, rarity=rarity, minlvl=minlvl, maxlvl=maxlvl
     }}
     }}
 
     <tr><td colspan="8" style="text-align: left; border-radius: 1px 1px 25px 25px; border: 1px solid {{#var:border}}; background-color: {{#var:cell}};">
     <tr class="pokemon-spawn-footer">
      <p style="margin-top: 8px; margin-left: 10px;">
      <td colspan="8">
        <ul>
        <div class="pokemon-spawn-note">
          <li><span style="color:#FF00BF; font-weight: bold;">Pink-colored</span> areas denote that this spawn is [[membership]]-exclusive</li>
          <ul>
          <li>'''Emboldened''' levels indicate they are isolatable with the [[Repel trick]]</li>
            <li><span>Pink-colored</span> areas denote that this spawn is [[membership]]-exclusive</li>
        </ul>
            <li>'''Emboldened''' levels indicate they are isolatable with the [[Repel trick]]</li>
      </p>
          </ul>
    </td></tr>
        </div>
   </table><br clear="all">
      </td>
| <!-- Else if no data found, show the message -->
    </tr>
   </table>
  <br clear="all">
}}
| <!-- If no data -->
   No spawn data available for this Pokémon.
   No spawn data available for this Pokémon.
}}
}}
</includeonly>
</includeonly>

Latest revision as of 06:19, 21 April 2025