Actions

Template

BuildingRefinerDisplayV2: Difference between revisions

From Dune Awakening DB

mNo edit summary
mNo edit summary
Line 1: Line 1:
<!-- Begin Building Card Template using externaldata directly -->
<!-- ========================
 
    1) GET BUILDING DATA
<!-- Fetch building data from data_buildings and filter by the current page name -->
    ======================== -->
{{#get_external_data: source=externaldb
{{#get_external_data: source=externaldb
  |from=data_buildings
  |from=data_buildings
  |data=Name=name,Tier=building_type,Description=description,PowerCost=power_cost,GeneratesPower=generates_power,StorageSlots=storage_slots,StorageVolume=storage_capacity,JourneyRequirement=journey_requirement,Health=health,PlacedWith=placed_with,AdditionalNotes=additional_notes,RecipeToBuild=recipe_to_build,ImageFile=image_file,Category1=category_1,Category2=category_2,Category3=category_3,YoutubeURL=youtube_video_link
  |data=
  Name=name,
  Tier=building_type,
  Description=description,
  PowerCost=power_cost,
  GeneratesPower=generates_power,
  StorageSlots=storage_slots,
  StorageVolume=storage_capacity,
  JourneyRequirement=journey_requirement,
  Health=health,
  PlacedWith=placed_with,
  AdditionalNotes=additional_notes,
  RecipeToBuild=recipe_to_build,
  ImageFile=image_file,
  Category1=category_1,
  Category2=category_2,
  Category3=category_3,
  YoutubeURL=youtube_video_link
  |cache=yes
  |cache=yes
  |filter=Name={{PAGENAME}}
  |filter=Name={{PAGENAME}}
}}
}}


{{#for_external_table:|
<!-- ========================
{{!}}-
    2) STORE THE FIRST ROW
{{!}} {{{Name}}}
    ======================== -->
{{!}} {{{Tier}}}
<!-- We expect exactly one row for the matching building.
{{!}} {{{Description}}}
    #for_external_table with format=plain and empty intro/outro
{{!}} {{{JourneyRequirement}}}
    ensures no visible table is output. -->
{{!}} {{{Health}}}
{{#for_external_table:
{{!}} {{{PowerCost}}}
|format=plain
{{!}} {{{GeneratesPower}}}
|intro=
{{!}} {{{StorageSlots}}}
|outro=
{{!}} {{{StorageVolume}}}
|separator=
{{!}} {{{RecipeToBuild}}}
|{{!}}-  
{{!}} {{{PlacedWith}}}
  {{#vardefine: buildingName            | {{{Name}}} }}
{{!}} {{{ImageFile}}}
  {{#vardefine: buildingTier            | {{{Tier}}} }}
{{!}} {{{AdditionalNotes}}}
  {{#vardefine: buildingDescription    | {{{Description}}} }}
{{!}} {{{YoutubeURL}}}
  {{#vardefine: buildingJourneyReq      | {{{JourneyRequirement}}} }}
{{!}} {{{Category1}}}
  {{#vardefine: buildingHealth          | {{{Health}}} }}
{{!}} {{{Category2}}}
  {{#vardefine: buildingPowerCost      | {{{PowerCost}}} }}
{{!}} {{{Category3}}}
  {{#vardefine: buildingGeneratesPower  | {{{GeneratesPower}}} }}
  {{#vardefine: buildingStorageSlots    | {{{StorageSlots}}} }}
  {{#vardefine: buildingStorageVolume  | {{{StorageVolume}}} }}
  {{#vardefine: buildingRecipeToBuild  | {{{RecipeToBuild}}} }}
  {{#vardefine: buildingPlacedWith      | {{{PlacedWith}}} }}
  {{#vardefine: buildingImageFile      | {{{ImageFile}}} }}
  {{#vardefine: buildingAdditionalNotes | {{{AdditionalNotes}}} }}
  {{#vardefine: buildingCategory3      | {{{Category3}}} }}
  {{#vardefine: buildingYoutubeURL      | {{{YoutubeURL}}} }}
}}
}}


<!-- =========================
    3) RENDER THE BUILDING CARD
    ========================= -->
<div class="responsive-container">
<div class="responsive-container">
  <!-- LEFT COLUMN -->
   <div class="responsive-col col1">
   <div class="responsive-col col1">
     <div class="skin-pivot">
     <div class="skin-pivot">
Line 38: Line 67:
           <div class="dune-card-label">SCHEMATIC – BUILDABLE</div>
           <div class="dune-card-label">SCHEMATIC – BUILDABLE</div>
           <div class="dune-card-title">
           <div class="dune-card-title">
             <span class="icon">&#x1F6C8;</span> {{{Name}}}
             <span class="icon">&#x1F6C8;</span> {{#var: buildingName }}
           </div>
           </div>
           <div class="dune-card-image">
           <div class="dune-card-image">
             [[File:{{{ImageFile}}}|200px|alt={{{Name}}}|style:max-width:100%;max-height:150px;object-fit:contain;border:2px solid #e2d3ae;border-radius:4px;padding:2px;background-color:#262626;]]
             [[File:{{#var: buildingImageFile }}|200px
              |alt={{#var: buildingName }}
              |style=max-width:100%;max-height:150px;object-fit:contain;border:2px solid #e2d3ae;border-radius:4px;padding:2px;background-color:#262626;]]
          </div>
          <div class="dune-card-description">
            {{#var: buildingDescription }}
           </div>
           </div>
          <div class="dune-card-description">{{{Description}}}</div>
           <div class="dune-card-locked">
           <div class="dune-card-locked">
             <div class="dune-card-locked-label">
             <div class="dune-card-locked-label">
               <span class="dune-card-locked-icon">&#128274;</span>Locked Behind
               <span class="dune-card-locked-icon">&#128274;</span>Locked Behind
             </div>
             </div>
             <div class="dune-card-locked-value">{{{JourneyRequirement}}}</div>
             <div class="dune-card-locked-value">
              {{#var: buildingJourneyReq }}
            </div>
           </div>
           </div>
           <div class="dune-card-infobox">
           <div class="dune-card-infobox">
Line 54: Line 89:
               <tr>
               <tr>
                 <th><span class="icon">&#127941;</span> Tier</th>
                 <th><span class="icon">&#127941;</span> Tier</th>
                 <td>{{{Tier}}}</td>
                 <td>{{#var: buildingTier }}</td>
               </tr>
               </tr>
               <tr>
               <tr>
Line 62: Line 97:
               <tr>
               <tr>
                 <th><span class="icon">&#9829;</span> Health</th>
                 <th><span class="icon">&#9829;</span> Health</th>
                 <td>{{{Health}}}</td>
                 <td>{{#var: buildingHealth }}</td>
               </tr>
               </tr>
               <tr>
               <tr>
                 <th><span class="icon">&#9889;</span> Power Cost</th>
                 <th><span class="icon">&#9889;</span> Power Cost</th>
                 <td>{{{PowerCost}}}</td>
                 <td>{{#var: buildingPowerCost }}</td>
               </tr>
               </tr>
               <tr>
               <tr>
                 <th><span class="icon">&#128230;</span> Inventory Slots</th>
                 <th><span class="icon">&#128230;</span> Inventory Slots</th>
                 <td>{{{StorageSlots}}}</td>
                 <td>{{#var: buildingStorageSlots }}</td>
               </tr>
               </tr>
               <tr>
               <tr>
                 <th><span class="icon">&#128451;</span> Volume Capacity</th>
                 <th><span class="icon">&#128451;</span> Volume Capacity</th>
                 <td>{{{StorageVolume}}}</td>
                 <td>{{#var: buildingStorageVolume }}</td>
               </tr>
               </tr>
               <tr>
               <tr>
                 <th><span class="icon">&#9883;</span> Components</th>
                 <th><span class="icon">&#9883;</span> Components</th>
                 <td>{{{RecipeToBuild}}}</td>
                 <td>{{#var: buildingRecipeToBuild }}</td>
               </tr>
               </tr>
               <tr>
               <tr>
                 <th><span class="icon">&#128296;</span> Placed With</th>
                 <th><span class="icon">&#128296;</span> Placed With</th>
                 <td>{{{PlacedWith}}}</td>
                 <td>{{#var: buildingPlacedWith }}</td>
               </tr>
               </tr>
             </table>
             </table>
Line 91: Line 126:
   </div>
   </div>


  <!-- MIDDLE COLUMN -->
   <div class="responsive-col col2">
   <div class="responsive-col col2">
     <!-- Refining Recipes Card -->
     <!-- REFINING RECIPES CARD -->
     <div class="skin-pivot" style="margin-bottom:20px;">
     <div class="skin-pivot" style="margin-bottom:20px;">
       <div class="dune-card">
       <div class="dune-card">
Line 102: Line 138:
           </div>
           </div>
           <div class="dune-card-description">
           <div class="dune-card-description">
             Below is a list of possible outputs, required inputs, and the time to refine. Times or power usage might vary based on external modifiers (e.g., upgrades).
             Below is a list of possible outputs, required inputs, and the time to refine.
            Times or power usage might vary based on external modifiers (e.g., upgrades).
           </div>
           </div>
           <div class="dune-card-infobox-left">
           <div class="dune-card-infobox-left">
             <!-- Fetch refining recipes for this building by filtering the recipes table -->
             <!-- =========================
             {{#get_external_data: source=externaldb
                4) GET REFINING RECIPES
                ========================= -->
             {{#get_external_data:
            |source=externaldb
             |from=data_refining_recipes
             |from=data_refining_recipes
             |data=Refiner=Refiner,Output=Output,Ingredients=Ingredients,Time=Time,Recipe=Recipe
             |data=Refiner=Refiner,Output=Output,Ingredients=Ingredients,Time=Time,Recipe=Recipe
             |cache=yes
             |cache=yes
             |filter=Refiner={{{Name}}}
             |filter=Refiner={{#var: buildingName }}
             }}
             }}
             {{#for_external_table:|
 
              {{!}}-
             <!-- We'll output an HTML table of recipes -->
            <table class="infobox-dune">
               <tr>
               <tr>
                 <td style="text-align:left;">{{{Output}}}</td>
                 <th style="text-align:left;">Output</th>
                 <td style="text-align:left;">{{{Ingredients}}}</td>
                 <th style="text-align:left;">Ingredients</th>
                 <td style="text-align:left;">{{{Time}}}</td>
                 <th style="text-align:left;">Craft Time</th>
               </tr>
               </tr>
            }}
 
              {{#for_external_table:
              |format=plain
              |intro=
              |outro=
              |separator=
              |{{!}}-
                <tr>
                  <td style="text-align:left;">{{{Output}}}</td>
                  <td style="text-align:left;">{{{Ingredients}}}</td>
                  <td style="text-align:left;">{{{Time}}}</td>
                </tr>
              }}
            </table>
           </div>
           </div>
         </div>
         </div>
Line 125: Line 180:
     </div>
     </div>


    <!-- ADDITIONAL INFO CARD -->
     <div class="skin-pivot" style="margin-bottom:20px;">
     <div class="skin-pivot" style="margin-bottom:20px;">
       <div class="dune-card">
       <div class="dune-card">
Line 133: Line 189:
             <span class="icon">&#8801;</span> Notes
             <span class="icon">&#8801;</span> Notes
           </div>
           </div>
           <div class="dune-card-description">{{{AdditionalNotes}}}</div>
           <div class="dune-card-description">
            {{#var: buildingAdditionalNotes }}
          </div>
         </div>
         </div>
       </div>
       </div>
Line 139: Line 197:
   </div>
   </div>


  <!-- RIGHT COLUMN -->
   <div class="responsive-col col3">
   <div class="responsive-col col3">
    <!-- VIDEO TUTORIALS -->
     <div class="skin-pivot" style="margin-bottom:20px;">
     <div class="skin-pivot" style="margin-bottom:20px;">
       <div class="dune-card">
       <div class="dune-card">
Line 149: Line 209:
           </div>
           </div>
           <div class="dune-card-video" style="border:2px solid #e2d3ae;border-radius:4px;padding:2px;background-color:#262626;">
           <div class="dune-card-video" style="border:2px solid #e2d3ae;border-radius:4px;padding:2px;background-color:#262626;">
            <!-- Simplified YouTube embed: if a Youtube URL is provided, embed it -->
             {{#if: {{#var: buildingYoutubeURL }} |  
             {{#if: {{{YoutubeURL|}}} | <youtube>{{{YoutubeURL}}}</youtube> | Coming Soon }}
              <youtube>{{#var: buildingYoutubeURL }}</youtube>  
              | Coming Soon
            }}
           </div>
           </div>
         </div>
         </div>
Line 156: Line 218:
     </div>
     </div>


    <!-- RELATED BUILDINGS -->
     <div class="skin-pivot">
     <div class="skin-pivot">
       <div class="dune-card">
       <div class="dune-card">
Line 162: Line 225:
           <div class="dune-card-label">RELATED BUILDINGS</div>
           <div class="dune-card-label">RELATED BUILDINGS</div>
           <div class="dune-card-title">
           <div class="dune-card-title">
             <span class="icon">&#x1F3D7;</span> Other {{{Category3}}}
             <span class="icon">&#x1F3D7;</span> Other {{#var: buildingCategory3 }}
           </div>
           </div>
           <div class="dune-card-description">
           <div class="dune-card-description">
             {{{RelatedBuildingsDescription|Explore similar building types to expand your base capabilities.}}}
             {{{RelatedBuildingsDescription|Explore similar building types to expand your base capabilities.}}}
           </div>
           </div>
           <div class="dune-card-infobox">
           <div class="dune-card-infobox">
             <!-- Pull related buildings from data_buildings by matching Category3 -->
             <!-- ============================
             {{#get_external_data: source=externaldb
                5) GET RELATED BUILDINGS
                ============================ -->
             {{#get_external_data:
            |source=externaldb
             |from=data_buildings
             |from=data_buildings
             |data=Name=name,Tier=building_type,Description=description,ImageFile=image_file,Category3=category_3
             |data=
              Name=name,
              Tier=building_type,
              Description=description,
              ImageFile=image_file,
              Category3=category_3
             |cache=yes
             |cache=yes
             |filter=Category3={{{Category3}}}
             |filter=Category3={{#var: buildingCategory3 }}
            }}
            {{#for_external_table:|
              {{!}}-
              [[{{{Name}}}]] ({{{Tier}}})<br>{{{Description}}}<br>
             }}
             }}
            <!-- We can display them as a mini-list -->
            <table class="infobox-dune" style="width:100%;">
              <tr>
                <th style="text-align:left;">Name</th>
                <th style="text-align:left;">Tier</th>
                <th style="text-align:left;">Description</th>
              </tr>
              {{#for_external_table:
              |format=plain
              |intro=
              |outro=
              |separator=
              |{{!}}-
                <tr>
                  <td>[[{{{Name}}}]] ({{{Tier}}})</td>
                  <td>{{{Tier}}}</td>
                  <td>{{{Description}}}</td>
                </tr>
              }}
            </table>
           </div>
           </div>
         </div>
         </div>
Line 187: Line 276:
   <div style="clear:both;"></div>
   <div style="clear:both;"></div>
</div>
</div>
<!-- End Building Card Template -->

Revision as of 22:09, 25 March 2025


format=plain

format=plain
format=plain
format=plain
format=plain
format=plain

SCHEMATIC – BUILDABLE
           🛈 {{{Name}}}
           [[File:{{{ImageFile}}}|200px
             |alt={{{Name}}}
             |style=max-width:100%;max-height:150px;object-fit:contain;border:2px solid #e2d3ae;border-radius:4px;padding:2px;background-color:#262626;]]
           {{{Description}}}
             🔒Locked Behind
             {{{JourneyRequirement}}}
🏅 Tier {{{Tier}}}
Primary Source Crafting
Health {{{Health}}}
Power Cost {{{PowerCost}}}
📦 Inventory Slots {{{StorageSlots}}}
🗃 Volume Capacity {{{StorageVolume}}}
Components {{{RecipeToBuild}}}
🔨 Placed With {{{PlacedWith}}}
CRAFTING
            Refining Recipes
           Below is a list of possible outputs, required inputs, and the time to refine.
           Times or power usage might vary based on external modifiers (e.g., upgrades).
           Error: Unknown database type .
format=plain format=plain format=plain format=plain format=plain format=plain
Output Ingredients Craft Time
Additional Information
            Notes
           {{{AdditionalNotes}}}
VIDEO TUTORIALS
            Building Guide
           Provided ID could not be validated.
RELATED BUILDINGS
           🏗 Other {{{Category3}}}
           Explore similar building types to expand your base capabilities.
           Error: Unknown database type .
format=plain format=plain format=plain format=plain format=plain format=plain
Name Tier Description