Actions

Template

BuildingRefinerDisplayV2: Difference between revisions

From Dune Awakening DB

mNo edit summary
mNo edit summary
 
(43 intermediate revisions by the same user not shown)
Line 1: Line 1:
<!-- ========================
<templatestyles src="Template:BuildingPage/styles.css" />
    1) GET BUILDING DATA
{{#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}}
    ======================== -->
{{#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=
| {{#vardefine:AdditionalNotes|{{{AdditionalNotes}}}}}
  Name=name,
| <!-- fallback already set inside external data loop -->
  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
|filter=Name={{PAGENAME}}
}}
}}
<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>


<!-- ========================
    2) STORE THE FIRST ROW
    ======================== -->
<!-- We expect exactly one row for the matching building.
    #for_external_table with format=plain and empty intro/outro
    ensures no visible table is output. -->
{{#for_external_table:
|format=plain
|intro=
|outro=
|separator=
|{{!}}-
  {{#vardefine: buildingName            | {{{Name}}} }}
  {{#vardefine: buildingTier            | {{{Tier}}} }}
  {{#vardefine: buildingDescription    | {{{Description}}} }}
  {{#vardefine: buildingJourneyReq      | {{{JourneyRequirement}}} }}
  {{#vardefine: buildingHealth          | {{{Health}}} }}
  {{#vardefine: buildingPowerCost      | {{{PowerCost}}} }}
  {{#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 -->
   <!-- Left Column -->
   <div class="responsive-col col1">
   <div class="responsive-col col1">
     <div class="skin-pivot">
     <div class="skin-pivot">
Line 66: 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">
           <div class="dune-card-title"><span class="icon">&#x1F6C8;</span> Building Information</div>
            <span class="icon">&#x1F6C8;</span> {{#var: buildingName }}
           <div style="padding:3px;"></div>
           </div>
         
           <div class="dune-card-image">
          <!-- Image Section -->
             [[File:{{#var: buildingImageFile }}|200px
           <div class="dune-card-image" style="text-align: center;">
              |alt={{#var: buildingName }}
             <div class="has-border">{{#if:{{#var:ImageFile}}
              |style=max-width:100%;max-height:150px;object-fit:contain;border:2px solid #e2d3ae;border-radius:4px;padding:2px;background-color:#262626;]]
                | [[File:{{#var:ImageFile}}|200px|alt={{#var:Name}}]]
          </div>
                | [[File:Placeholder.png|200px|alt=No image available]]}}
          <div class="dune-card-description">
            </div>
            {{#var: buildingDescription }}
           </div>
           </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">
              {{#var: buildingJourneyReq }}
            </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>{{#var: buildingTier }}</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>{{#var: buildingHealth }}</td>
              </tr>
               <tr>
                <th><span class="icon">&#9889;</span> Power Cost</th>
                <td>{{#var: buildingPowerCost }}</td>
              </tr>
               <tr>
                <th><span class="icon">&#128230;</span> Inventory Slots</th>
                <td>{{#var: buildingStorageSlots }}</td>
              </tr>
               <tr>
                <th><span class="icon">&#128451;</span> Volume Capacity</th>
                <td>{{#var: buildingStorageVolume }}</td>
              </tr>
               <tr>
                <th><span class="icon">&#9883;</span> Components</th>
                <td>{{#var: buildingRecipeToBuild }}</td>
              </tr>
               <tr>
                <th><span class="icon">&#128296;</span> Placed With</th>
                <td>{{#var: buildingPlacedWith }}</td>
              </tr>
             </table>
             </table>
           </div>
           </div>
Line 126: Line 56:
   </div>
   </div>


   <!-- MIDDLE COLUMN -->
   <!-- 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>
         <div class="dune-card-inner">
         <div class="dune-card-inner">
           <div class="dune-card-label">CRAFTING</div>
           <div class="dune-card-label">CRAFTING</div>
           <div class="dune-card-title">
           <div class="dune-card-title"><span class="icon">&#9883;</span> Refining Recipes</div>
            <span class="icon">&#9883;</span> Refining Recipes
           <div style="padding:3px;"></div>
           </div>
           <div class="dune-card-description">Below is a list of possible outputs, required inputs, and the time to refine.</div>
           <div class="dune-card-description">
         
            Below is a list of possible outputs, required inputs, and the time to refine.
          <!-- Refining Recipes -->
             Times or power usage might vary based on external modifiers (e.g., upgrades).
          <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">
          <div style="clear:both; padding:10px;"></div>
            <!-- =========================
         
                4) GET REFINING RECIPES
          <!-- Other Refiners content integrated here -->
                ========================= -->
           <div class="dune-card-title"><span class="icon">&#x1F3D7;</span> Other {{#var:Category3}}</div>
          <div style="padding:3px;"></div>
          <div class="dune-card-description">Explore similar building types to expand your base capabilities.</div>
          <div class="dune-table-wrapper">
             {{#get_external_data:
             {{#get_external_data:
            |source=externaldb
              source=externaldb
            |from=data_refining_recipes
              |from=data_buildings
            |data=Refiner=Refiner,Output=Output,Ingredients=Ingredients,Time=Time,Recipe=Recipe
              |data=Name=name,BuildingType=building_type,Category3=category_3
            |cache=yes
              |cache=yes
            |filter=Refiner={{#var: buildingName }}
              |where=category_3='{{#var:Category3}}'
             }}
             }}
 
             <table class="infobox-dune-standard-table">
            <!-- We'll output an HTML table of recipes -->
               <tr class="tr-dark">
             <table class="infobox-dune">
                 <th style="text-align:left;">Name</th>
               <tr>
                 <th style="text-align:left;">Tier</th>
                 <th style="text-align:left;">Output</th>
                 <th style="text-align:left;">Description</th>
                 <th style="text-align:left;">Ingredients</th>
                 <th style="text-align:left;">Craft Time</th>
               </tr>
               </tr>
 
               {{#for_external_table:|
               {{#for_external_table:
                <tr>
              |format=plain
                  <td style="text-align:left;">{{{Name}}}</td>
              |intro=
                  <td style="text-align:left;">{{{BuildingType}}}</td>
              |outro=
                  <td style="text-align:left;">{{{Category3}}}</td>
              |separator=
                </tr>
              |{{!}}-
                <tr>
                  <td style="text-align:left;">{{{Output}}}</td>
                  <td style="text-align:left;">{{{Ingredients}}}</td>
                  <td style="text-align:left;">{{{Time}}}</td>
                </tr>
               }}
               }}
             </table>
             </table>
          </div>
        </div>
      </div>
    </div>
    <!-- ADDITIONAL INFO CARD -->
    <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">
            {{#var: buildingAdditionalNotes }}
           </div>
           </div>
         </div>
         </div>
Line 197: Line 129:
   </div>
   </div>


   <!-- RIGHT COLUMN -->
   <!-- Right Column -->
   <div class="responsive-col col3">
   <div class="responsive-col col3">
     <!-- VIDEO TUTORIALS -->
     <!-- Building Guide Video Card with Notes integrated -->
     <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>
         <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|}}}
             {{#if: {{#var: buildingYoutubeURL }} |
              | {{{YoutubeEmbed}}}
              <youtube>{{#var: buildingYoutubeURL }}</youtube>
               | <youtube>r8lxVDqoHLQ</youtube>}}
              | Coming Soon
            }}
          </div>
        </div>
      </div>
    </div>
 
    <!-- RELATED BUILDINGS -->
    <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 {{#var: buildingCategory3 }}
          </div>
          <div class="dune-card-description">
            {{{RelatedBuildingsDescription|Explore similar building types to expand your base capabilities.}}}
          </div>
 
          <div class="dune-card-infobox">
            <!-- ============================
                5) GET RELATED BUILDINGS
                ============================ -->
            {{#get_external_data:
            |source=externaldb
            |from=data_buildings
            |data=
              Name=name,
              Tier=building_type,
              Description=description,
              ImageFile=image_file,
              Category3=category_3
            |cache=yes
            |filter=Category3={{#var: buildingCategory3 }}
            }}
 
            <!-- 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 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>

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}}}