Actions

Template

BuildingRefinerDisplayV2: Difference between revisions

From Dune Awakening DB

mNo edit summary
mNo edit summary
 
(45 intermediate revisions by the same user not shown)
Line 1: Line 1:
<!-- Begin Building Card Template using externaldata directly -->
<templatestyles src="Template:BuildingPage/styles.css" />
 
{{#get_external_data:source=externaldb|from=data_buildings|data=ID=id,BuildingType=building_type,Name=name,Description=description,PowerCost=power_cost,GeneratesPower=generates_power,StorageSlots=storage_slots,StorageCapacity=storage_capacity,SchematicRequirement=schematic_requirement,JourneyRequirement=journey_requirement,Health=health,PlacedWith=placed_with,AdditionalNotes=additional_notes,RecipeToBuild=recipe_to_build,ImageFile=image_file,IconFile=icon_file,Category1=category_1,Category2=category_2,Category3=category_3,Gallery1=gallery_1,Gallery2=gallery_2,Gallery3=gallery_3,Gallery4=gallery_4,YoutubeVideoLink=youtube_video_link|cache=yes|where=name='{{PAGENAME}}'|limit=1}}
<!-- Fetch building data from data_buildings and filter by the current page name -->
{{#for_external_table:|{{#vardefine:Name|{{{Name}}}}}{{#vardefine:BuildingType|{{{BuildingType}}}}}{{#vardefine:Description|{{{Description}}}}}{{#vardefine:PowerCost|{{{PowerCost}}}}}{{#vardefine:GeneratesPower|{{{GeneratesPower}}}}}{{#vardefine:StorageSlots|{{{StorageSlots}}}}}{{#vardefine:StorageCapacity|{{{StorageCapacity}}}}}{{#vardefine:SchematicRequirement|{{{SchematicRequirement}}}}}{{#vardefine:JourneyRequirement|{{{JourneyRequirement}}}}}{{#vardefine:Health|{{{Health}}}}}{{#vardefine:PlacedWith|{{{PlacedWith}}}}}{{#vardefine:AdditionalNotes|{{{AdditionalNotes}}}}}{{#vardefine:RecipeToBuild|{{{RecipeToBuild}}}}}{{#vardefine:ImageFile|{{{ImageFile}}}}}{{#vardefine:IconFile|{{{IconFile}}}}}{{#vardefine:Category3|{{{Category3}}}}}{{#vardefine:Category2|{{{Category2}}}}}{{#vardefine:Category1|{{{Category1}}}}}{{#vardefine:YoutubeVideoLink|{{{YoutubeVideoLink}}}}} }}
{{#get_external_data: source=externaldb
<!-- Main container with reduced gaps for better wiki fit -->
|from=data_buildings
{{#if:{{{AdditionalNotes|}}}
|data=name=Name,tier=Tier,description=Description,journey_requirement=JourneyRequirement,health=Health,power_cost=PowerCost,generates_power=GeneratesPower,storage_slots=StorageSlots,storage_volume=StorageVolume,recipe_to_build=RecipeToBuild,placed_with=PlacedWith,image_file=ImageFile,additional_notes=AdditionalNotes,youtube_url=YoutubeURL,category1=Category1,category2=Category2,category3=Category3
| {{#vardefine:AdditionalNotes|{{{AdditionalNotes}}}}}
|cache=yes
| <!-- fallback already set inside external data loop -->
|filter=Name={{PAGENAME}}
}}
 
<!-- Process the externaldata output and assign parameters.
    (This step assumes the externaldata call returns only the matching row.)
    If you need additional filtering logic, consider wrapping the #for_external_table call. -->
 
{{#for_external_table:|
{{!}}-
{{!}} {{{Name}}}
{{!}} {{{Tier}}}
{{!}} {{{Description}}}
{{!}} {{{JourneyRequirement}}}
{{!}} {{{Health}}}
{{!}} {{{PowerCost}}}
{{!}} {{{GeneratesPower}}}
{{!}} {{{StorageSlots}}}
{{!}} {{{StorageVolume}}}
{{!}} {{{RecipeToBuild}}}
{{!}} {{{PlacedWith}}}
{{!}} {{{ImageFile}}}
{{!}} {{{AdditionalNotes}}}
{{!}} {{{YoutubeURL}}}
{{!}} {{{Category1}}}
{{!}} {{{Category2}}}
{{!}} {{{Category3}}}
}}
}}
<div class="dune-breadcrumb-nav">
  <span id="menuRadialTrigger" class="menu-button-wrapper" style="cursor:pointer;">[[File:MenuButton.png|100px|link=|alt=Menu]]</span><span class="dune-breadcrumb-separator">/</span>[[{{#var:Category1}}|{{#var:Category1}}]]<span class="dune-breadcrumb-separator">/</span>[[{{#var:Category2}}|{{#var:Category2}}]]<span class="dune-breadcrumb-separator">/</span>[[{{#var:Category3}}|{{#var:Category3}}]]<span class="dune-breadcrumb-separator">/</span><span>{{PAGENAME}}</span></div>


<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 42: Line 18:
         <div class="dune-card-inner">
         <div class="dune-card-inner">
           <div class="dune-card-label">SCHEMATIC – BUILDABLE</div>
           <div class="dune-card-label">SCHEMATIC – BUILDABLE</div>
           <div class="dune-card-title"><span class="icon">&#x1F6C8;</span> {{{Name}}}</div>
           <div class="dune-card-title"><span class="icon">&#x1F6C8;</span> Building Information</div>
           <div class="dune-card-image">
          <div style="padding:3px;"></div>
             [[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;]]
         
          <!-- Image Section -->
           <div class="dune-card-image" style="text-align: center;">
             <div class="has-border">{{#if:{{#var:ImageFile}}
                | [[File:{{#var:ImageFile}}|200px|alt={{#var:Name}}]]
                | [[File:Placeholder.png|200px|alt=No image available]]}}
            </div>
           </div>
           </div>
           <div class="dune-card-description">{{{Description}}}</div>
          <div style="padding:3px;"></div>
         
          <!-- Description -->
           <div class="dune-card-description">{{#invoke:DataTableParserV2|iconize|{{#var:Description}}}}</div>
         
          <!-- Locked Behind -->
           <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</div>
              <span class="dune-card-locked-icon">&#128274;</span>Locked Behind
             <div class="dune-card-locked-value">{{#var:JourneyRequirement}}</div>
            </div>
             <div class="dune-card-locked-value">{{{JourneyRequirement}}}</div>
           </div>
           </div>
           <div class="dune-card-infobox">
 
             <table class="infobox-dune">
          <!-- Table -->
               <tr>
           <div class="dune-table-wrapper">
                <th><span class="icon">&#127941;</span> Tier</th>
             <table class="infobox-dune-two-column">
                <td>{{{Tier}}}</td>
               <tr><th><span class="icon">[[File:BuildingTypeIcon.png]]</span> Building Type</th><td>{{#var:BuildingType}}</td></tr>
              </tr>
               <tr><th><span class="icon">[[File:BuildingHealthIcon.png]]</span> Health</th><td>{{#var:Health}}</td></tr>
               <tr>
               <tr><th><span class="icon">[[File:BuildingPowerIcon.png]]</span> Power Cost</th><td>{{#var:PowerCost}}</td></tr>
                <th><span class="icon">&#9881;</span> Primary Source</th>
               <tr><th><span class="icon">[[File:BuildingInventoryIcon.png]]</span> Inventory Slots</th><td>{{#var:StorageSlots}}</td></tr>
                <td>Crafting</td>
               <tr><th><span class="icon">[[File:BuildingCapacityIcon.png]]</span> Capacity</th><td>{{#var:StorageCapacity}}</td></tr>
              </tr>
               <tr><th><span class="icon">[[File:BuildingRecipeIcon.png]]</span> Recipe</th><td>{{#invoke:DataTableParserV2|iconize|{{#var:RecipeToBuild}}}}</td></tr>
              <tr>
               <tr><th><span class="icon">[[File:BuildingPlacedWithIcon.png]]</span> Placed With</th><td>{{#invoke:DataTableParserV2|iconize|{{#var:PlacedWith}}}}</td></tr>
                <th><span class="icon">&#9829;</span> Health</th>
                <td>{{{Health}}}</td>
              </tr>
               <tr>
                <th><span class="icon">&#9889;</span> Power Cost</th>
                <td>{{{PowerCost}}}</td>
              </tr>
               <tr>
                <th><span class="icon">&#128230;</span> Inventory Slots</th>
                <td>{{{StorageSlots}}}</td>
              </tr>
               <tr>
                <th><span class="icon">&#128451;</span> Volume Capacity</th>
                <td>{{{StorageVolume}}}</td>
              </tr>
               <tr>
                <th><span class="icon">&#9883;</span> Components</th>
                <td>{{{RecipeToBuild}}}</td>
              </tr>
               <tr>
                <th><span class="icon">&#128296;</span> Placed With</th>
                <td>{{{PlacedWith}}}</td>
              </tr>
             </table>
             </table>
           </div>
           </div>
Line 94: Line 56:
   </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">
       <div class="dune-card">
       <div class="dune-card">
         <div class="dune-card-decoration"></div>
         <div class="dune-card-decoration"></div>
Line 102: Line 65:
           <div class="dune-card-label">CRAFTING</div>
           <div class="dune-card-label">CRAFTING</div>
           <div class="dune-card-title"><span class="icon">&#9883;</span> Refining Recipes</div>
           <div class="dune-card-title"><span class="icon">&#9883;</span> Refining Recipes</div>
           <div class="dune-card-description">
          <div style="padding:3px;"></div>
            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 class="dune-card-description">Below is a list of possible outputs, required inputs, and the time to refine.</div>
         
          <!-- Refining Recipes -->
          <div class="dune-card-infobox-left">
            {{#get_external_data:
              source=externaldb
              |from=data_refining_recipes
              |data=Output=name,Time=time_to_smelt,Recipe=recipe_to_smelt,Refiner=refiner_needed
              |cache=yes
              |where=refiner_needed='{{PAGENAME}}'
            }}
            <div class="dune-table-wrapper" style="overflow-x: auto;">
              <table class="infobox-dune-standard-table">
                <tr class="tr-dark">
                  <th style="text-align:left; width:30%;">Output</th>
                  <th style="text-align:left; width:50%;">Recipe</th>
                  <th style="text-align:left; width:20%;">Craft Time</th>
                </tr>
                {{#for_external_table:|
                  <tr>
                    <td style="text-align:left;">{{#invoke:DataTableParserV2|iconize|1={{{Output}}}}}</td>
                    <td style="text-align:left;">{{#invoke:DataTableParserV2|formatRecipeList|1={{{Recipe}}}}}</td>
                    <td style="text-align:left;">{{{Time}}}</td>
                  </tr>
                }}
              </table>
            </div>
           </div>
           </div>
           <div class="dune-card-infobox-left">
         
            <!-- Fetch refining recipes for this building by filtering the recipes table -->
          <div style="clear:both; padding:10px;"></div>
             {{#get_external_data: source=externaldb
         
            |from=data_refining_recipes
          <!-- Other Refiners content integrated here -->
            |data=refiner=Refiner,output=Output,ingredients=Ingredients,time=Time,recipe=Recipe
           <div class="dune-card-title"><span class="icon">&#x1F3D7;</span> Other {{#var:Category3}}</div>
            |cache=yes
          <div style="padding:3px;"></div>
            |filter=Refiner={{{Name}}}
          <div class="dune-card-description">Explore similar building types to expand your base capabilities.</div>
          <div class="dune-table-wrapper">
             {{#get_external_data:
              source=externaldb
              |from=data_buildings
              |data=Name=name,BuildingType=building_type,Category3=category_3
              |cache=yes
              |where=category_3='{{#var:Category3}}'
             }}
             }}
             {{#for_external_table:|
             <table class="infobox-dune-standard-table">
              {{!}}-
               <tr class="tr-dark">
               <tr>
                 <th style="text-align:left;">Name</th>
                 <td style="text-align:left;">{{{Output}}}</td>
                 <th style="text-align:left;">Tier</th>
                 <td style="text-align:left;">{{{Ingredients}}}</td>
                 <th style="text-align:left;">Description</th>
                 <td style="text-align:left;">{{{Time}}}</td>
               </tr>
               </tr>
            }}
              {{#for_external_table:|
                <tr>
                  <td style="text-align:left;">{{{Name}}}</td>
                  <td style="text-align:left;">{{{BuildingType}}}</td>
                  <td style="text-align:left;">{{{Category3}}}</td>
                </tr>
              }}
            </table>
           </div>
           </div>
        </div>
      </div>
    </div>
    <div class="skin-pivot" style="margin-bottom:20px;">
      <div class="dune-card">
        <div class="dune-card-decoration"></div>
        <div class="dune-card-inner">
          <div class="dune-card-label">Additional Information</div>
          <div class="dune-card-title"><span class="icon">&#8801;</span> Notes</div>
          <div class="dune-card-description">{{{AdditionalNotes}}}</div>
         </div>
         </div>
       </div>
       </div>
Line 138: Line 129:
   </div>
   </div>


  <!-- Right Column -->
   <div class="responsive-col col3">
   <div class="responsive-col col3">
     <div class="skin-pivot" style="margin-bottom:20px;">
    <!-- Building Guide Video Card with Notes integrated -->
     <div class="skin-pivot">
       <div class="dune-card">
       <div class="dune-card">
         <div class="dune-card-decoration"></div>
         <div class="dune-card-decoration"></div>
         <div class="dune-card-inner">
         <div class="dune-card-inner">
           <div class="dune-card-label">VIDEO TUTORIALS</div>
           <div class="dune-card-label">VIDEO TUTORIALS</div>
           <div class="dune-card-title">
           <div class="dune-card-title"><span class="icon">&#9654;</span> Building Guide</div>
            <span class="icon">&#9654;</span> {{{VideoTitle|Building Guide}}}
           <div style="padding:3px;"></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;">
             {{#if:{{{YoutubeEmbed|}}}
            <!-- Simplified YouTube embed: if a Youtube URL is provided, embed it -->
              | {{{YoutubeEmbed}}}
             {{#if: {{{YoutubeURL|}}} | <youtube>{{{YoutubeURL}}}</youtube> | Coming Soon }}
              | <youtube>r8lxVDqoHLQ</youtube>}}
          </div>
        </div>
      </div>
    </div>
 
    <div class="skin-pivot">
      <div class="dune-card">
        <div class="dune-card-decoration"></div>
        <div class="dune-card-inner">
          <div class="dune-card-label">RELATED BUILDINGS</div>
          <div class="dune-card-title">
            <span class="icon">&#x1F3D7;</span> Other {{{Category3}}}
          </div>
          <div class="dune-card-description">
            {{{RelatedBuildingsDescription|Explore similar building types to expand your base capabilities.}}}
          </div>
          <div class="dune-card-infobox">
            <!-- Pull related buildings from data_buildings by matching Category3 -->
            {{#get_external_data: source=externaldb
            |from=data_buildings
            |data=name=Name,tier=Tier,description=Description,image_file=ImageFile,category3=Category3
            |cache=yes
            |filter=Category3={{{Category3}}}
            }}
            {{#for_external_table:|
              {{!}}-
              [[{{{Name}}}]] ({{{Tier}}})<br>{{{Description}}}<br>
            }}
           </div>
           </div>
         
          <div style="clear:both; padding:10px;"></div>
         
          <!-- Notes content integrated here -->
          <div class="dune-card-title"><span class="icon">&#8801;</span> Notes</div>
          <div style="padding:3px;"></div>
          <div class="dune-card-description">{{#invoke:DataTableParserV2|iconize|{{#var:AdditionalNotes}}}}</div>
         </div>
         </div>
       </div>
       </div>
     </div>
     </div>
   </div>
   </div>
  <div style="clear:both;"></div>
</div>
</div>
<!-- End Building Card Template -->

Latest revision as of 01:05, 23 May 2025


Menu/[[{{{Category1}}}|{{{Category1}}}]]/[[{{{Category2}}}|{{{Category2}}}]]/[[{{{Category3}}}|{{{Category3}}}]]/BuildingRefinerDisplayV2
SCHEMATIC – BUILDABLE
🛈 Building Information
[[File:{{{ImageFile}}}|200px|alt={{{Name}}}]]
{{{Description}}}
🔒Locked Behind
{{{JourneyRequirement}}}
Building Type{{{BuildingType}}}
Health{{{Health}}}
Power Cost{{{PowerCost}}}
Inventory Slots{{{StorageSlots}}}
Capacity{{{StorageCapacity}}}
Recipe{{{RecipeToBuild}}}
Placed With{{{PlacedWith}}}
CRAFTING
Refining Recipes
Below is a list of possible outputs, required inputs, and the time to refine.
           The query SELECT  name,time_to_smelt,recipe_to_smelt,refiner_needed  FROM `data_refining_recipes`    WHERE refiner_needed='BuildingRefinerDisplayV2'   is invalid (Error 1146: Table 'dunedbco_ddb.data_refining_recipes' doesn't exist

Function: EDConnectorRdbms::fetch Query: SELECT name,time_to_smelt,recipe_to_smelt,refiner_needed FROM `data_refining_recipes` WHERE refiner_needed='BuildingRefinerDisplayV2' ).

Output Recipe Craft Time
🏗 Other {{{Category3}}}
Explore similar building types to expand your base capabilities.
Name Tier Description
VIDEO TUTORIALS
Building Guide
Notes
{{{AdditionalNotes}}}