Actions

Template

BuildingRefinerDisplayV2: Difference between revisions

From Dune Awakening DB

mNo edit summary
mNo edit summary
Line 1: Line 1:
<div class="responsive-container">
<!-- Begin Building Card Template using externaldata directly -->
 


<!-- 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
  |where=name='{{PAGENAME}}'
  |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
|data=building_id=id,building_type=building_type,building_name=name,building_description=description,
|cache=yes
        building_power=power_cost,generates_power=generates_power,storage_slots=storage_slots,
|filter=Name={{PAGENAME}}
        storage_capacity=storage_capacity,schematic_req=schematic_requirement,
        journey_req=journey_requirement,building_health=health,placed_with=placed_with,
        additional_notes=additional_notes,recipe=recipe_to_build,
        image_file=image_file,icon_file=icon_file,
        cat1=category_1,cat2=category_2,cat3=category_3,
        youtube_link=youtube_video_link
}}
}}


<div class="responsive-col col1">
<!-- Process the externaldata output and assign parameters.
<div class="skin-pivot">
    (This step assumes the externaldata call returns only the matching row.)
<div class="dune-card">
    If you need additional filtering logic, consider wrapping the #for_external_table call. -->
<div class="dune-card-decoration"></div>
 
<div class="dune-card-inner">
{{#for_external_table:|
<div class="dune-card-label">SCHEMATIC – BUILDABLE</div>
{{!}}-
<div class="dune-card-title"><span class="icon">&#x1F6C8;</span> {{#external_value:building_name}}</div>
{{!}} {{{Name}}}
<div class="dune-card-image">[[File:{{#external_value:image_file}}|200px|alt={{#external_value:building_name}}|style:max-width:100%;max-height:150px;object-fit:contain;border:2px solid #e2d3ae;border-radius:4px;padding:2px;background-color:#262626;]]</div>
{{!}} {{{Tier}}}
<div class="dune-card-description">{{#external_value:building_description}}</div>
{{!}} {{{Description}}}
<div class="dune-card-locked">
{{!}} {{{JourneyRequirement}}}
<div class="dune-card-locked-label"><span class="dune-card-locked-icon">&#128274;</span>Locked Behind</div>
{{!}} {{{Health}}}
<div class="dune-card-locked-value">{{#external_value:journey_req}}</div>
{{!}} {{{PowerCost}}}
</div>
{{!}} {{{GeneratesPower}}}
<div class="dune-card-infobox">
{{!}} {{{StorageSlots}}}
<table class="infobox-dune">
{{!}} {{{StorageVolume}}}
<tr><th><span class="icon">&#127941;</span> Type</th><td>{{#external_value:building_type}}</td></tr>
{{!}} {{{RecipeToBuild}}}
<tr><th><span class="icon">&#9881;</span> Primary Source</th><td>Crafting</td></tr>
{{!}} {{{PlacedWith}}}
<tr><th><span class="icon">&#9829;</span> Health</th><td>{{#external_value:building_health}}</td></tr>
{{!}} {{{ImageFile}}}
<tr><th><span class="icon">&#9889;</span> Power Cost</th><td>{{#external_value:building_power}}</td></tr>
{{!}} {{{AdditionalNotes}}}
<tr><th><span class="icon">&#128230;</span> Inventory Slots</th><td>{{#external_value:storage_slots}}</td></tr>
{{!}} {{{YoutubeURL}}}
<tr><th><span class="icon">&#128451;</span> Volume Capacity</th><td>{{#external_value:storage_capacity}}</td></tr>
{{!}} {{{Category1}}}
<tr><th><span class="icon">&#9883;</span> Components</th><td>
{{!}} {{{Category2}}}
{{#get_external_data: source=externaldb
{{!}} {{{Category3}}}
|from=data_resources
}}
|where=name IN ({{#external_value:recipe}})
 
|data=comp_name=name,comp_icon=icon_file}}
<div class="responsive-container">
{{#for_external_table:|[[File:{{#external_value:comp_icon}}|20px]] [[{{#external_value:comp_name}}]]<br>}}
</td></tr>
<tr><th><span class="icon">&#128296;</span> Placed With</th><td>{{#external_value:placed_with}}</td></tr>
</table>
</div>
</div>
</div>
</div>
</div>


<div class="responsive-col col2">
  <div class="responsive-col col1">
<!-- Refining Recipes Card -->
    <div class="skin-pivot">
<div class="skin-pivot" style="margin-bottom:20px;">
      <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">SCHEMATIC – BUILDABLE</div>
      <div class="dune-card-label">CRAFTING</div>
          <div class="dune-card-title"><span class="icon">&#x1F6C8;</span> {{{Name}}}</div>
      <div class="dune-card-title"><span class="icon">&#9883;</span> Refining Recipes</div>
          <div class="dune-card-image">
      <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).
            [[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;]]
          </div>
          <div class="dune-card-description">{{{Description}}}</div>
          <div class="dune-card-locked">
            <div class="dune-card-locked-label">
              <span class="dune-card-locked-icon">&#128274;</span>Locked Behind
            </div>
            <div class="dune-card-locked-value">{{{JourneyRequirement}}}</div>
          </div>
          <div class="dune-card-infobox">
            <table class="infobox-dune">
              <tr>
                <th><span class="icon">&#127941;</span> Tier</th>
                <td>{{{Tier}}}</td>
              </tr>
              <tr>
                <th><span class="icon">&#9881;</span> Primary Source</th>
                <td>Crafting</td>
              </tr>
              <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>
          </div>
        </div>
       </div>
       </div>
    <div class="dune-card-infobox-left">
  <table class="infobox-dune">
    {{#get_external_data: source=externaldb
    |from=data_refining_recipes
    |where=refiner_needed='{{PAGENAME}}
'
    |data=output_item=OutputItem,ingredients=Ingredients,time=Time,recipe_qty=RecipeQty
    }}
    <tr>
      <th style="text-align:left;">Output</th>
      <th style="text-align:left;">Ingredients</th>
      <th style="text-align:left;">Craft Time</th>
    </tr>
    {{#for_external_table:|
    {{!}}-
    {{!}} {{#get_external_data: source=externaldb |from=data_resources |where=name='{{#external_value:OutputItem}}' |data=icon_file=IconFile}}[[File:{{#external_value:IconFile}}|20px]] [[{{#external_value:OutputItem}}]] {{#if: {{#external_value:RecipeQty}} | × {{#external_value:RecipeQty}} | }}
    {{!}} {{#get_external_data: source=externaldb |from=data_resources |where=name IN ({{#external_value:Ingredients}}) |data=name=IngName,icon_file=IngIconFile}}
    {{#for_external_table:|[[File:{{#external_value:IngIconFile}}|20px]] [[{{#external_value:IngName}}]]<br>}}
    {{!}} {{#external_value:Time}}
    }}
  </table>
</div>
     </div>
     </div>
   </div>
   </div>
</div>


<div class="skin-pivot" style="margin-bottom:20px;">
  <div class="responsive-col col2">
  <div class="dune-card">
    <!-- Refining Recipes Card -->
     <div class="dune-card-decoration"></div>
    <div class="skin-pivot" style="margin-bottom:20px;">
    <div class="dune-card-inner">
      <div class="dune-card">
      <div class="dune-card-label">Additional Information</div>
        <div class="dune-card-decoration"></div>
      <div class="dune-card-title"><span class="icon">&#8801;</span> Notes</div>
        <div class="dune-card-inner">
      <div class="dune-card-description">{{#external_value:additional_notes}}</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-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).
          </div>
          <div class="dune-card-infobox-left">
            <!-- Fetch refining recipes for this building by filtering the recipes table -->
            {{#get_external_data: source=externaldb
            |from=data_refining_recipes
            |data=refiner=Refiner,output=Output,ingredients=Ingredients,time=Time,recipe=Recipe
            |cache=yes
            |filter=Refiner={{{Name}}}
            }}
            {{#for_external_table:|
              {{!}}-
              <tr>
                <td style="text-align:left;">{{{Output}}}</td>
                <td style="text-align:left;">{{{Ingredients}}}</td>
                <td style="text-align:left;">{{{Time}}}</td>
              </tr>
            }}
          </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>
   </div>
   </div>
</div>
</div>


<div class="responsive-col col3">
  <div class="responsive-col col3">
<div class="skin-pivot" style="margin-bottom:20px;">
    <div class="skin-pivot" style="margin-bottom:20px;">
  <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"><span class="icon">&#9654;</span> {{{VideoTitle|Building Guide}}}</div>
          <div class="dune-card-title">
      <div class="dune-card-video" style="border:2px solid #e2d3ae;border-radius:4px;padding:2px;background-color:#262626;">
            <span class="icon">&#9654;</span> {{{VideoTitle|Building Guide}}}
    {{#if: {{#external_value:youtube_video_link}} |
          </div>
    <youtube dimensions="480x360" alignment="center">{{#replace: {{#external_value:youtube_video_link}} | .*v=([a-zA-Z0-9_-]+).* | $1 }}</youtube>
          <div class="dune-card-video" style="border:2px solid #e2d3ae;border-radius:4px;padding:2px;background-color:#262626;">
    | Coming Soon }}
            <!-- Simplified YouTube embed: if a Youtube URL is provided, embed it -->
</div>
            {{#if: {{{YoutubeURL|}}} | <youtube>{{{YoutubeURL}}}</youtube> | Coming Soon }}
  </div>
          </div>
</div>
        </div>
      </div>
    </div>


<div class="skin-pivot">
    <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">RELATED BUILDINGS</div>
          <div class="dune-card-label">RELATED BUILDINGS</div>
      <div class="dune-card-title"><span class="icon">&#x1F3D7;</span> Other {{#external_value:category_3}}</div>
          <div class="dune-card-title">
      <div class="dune-card-description">{{{RelatedBuildingsDescription|Explore similar building types to expand your base capabilities.}}}</div>
            <span class="icon">&#x1F3D7;</span> Other {{{Category3}}}
      <div class="dune-card-infobox">
          </div>
        {{#get_external_data: source=externaldb
          <div class="dune-card-description">
        |from=data_buildings
            {{{RelatedBuildingsDescription|Explore similar building types to expand your base capabilities.}}}
        |where=category_3='{{#external_value:category_3}}'
          </div>
        |data=name=RelatedName,building_type=RelatedType,description=RelatedDescription,icon_file=RelatedIconFile
          <div class="dune-card-infobox">
        }}
            <!-- Pull related buildings from data_buildings by matching Category3 -->
        <table class="infobox-dune" style="width:100%">
            {{#get_external_data: source=externaldb
        <tr>
            |from=data_buildings
          <th style="text-align:left;">Name</th>
            |data=name=Name,tier=Tier,description=Description,image_file=ImageFile,category3=Category3
          <th style="text-align:left;">Type</th>
            |cache=yes
          <th style="text-align:left;">Description</th>
            |filter=Category3={{{Category3}}}
        </tr>
            }}
        {{#for_external_table:|
            {{#for_external_table:|
        {{#if: {{#ifeq: {{#external_value:RelatedName}} | {{#var:BuildingName}} | | 1 }} |
              {{!}}-
        {{!}}-
              [[{{{Name}}}]] ({{{Tier}}})<br>{{{Description}}}<br>
        {{!}} [[File:{{#external_value:RelatedIconFile}}|20px]] [[{{#external_value:RelatedName}}]]
            }}
        {{!}} {{#external_value:RelatedType}}
          </div>
        {{!}} {{#external_value:RelatedDescription}}
         </div>
        |}}
        }}
         </table>
       </div>
       </div>
     </div>
     </div>
   </div>
   </div>
</div>
</div>


<div style="clear:both;"></div>
  <div style="clear:both;"></div>
</div>
</div>
<!-- End Building Card Template -->

Revision as of 21:56, 25 March 2025


The query SELECT Name,Tier,Description,JourneyRequirement,Health,PowerCost,GeneratesPower,StorageSlots,StorageVolume,RecipeToBuild,PlacedWith,ImageFile,AdditionalNotes,YoutubeURL,Category1,Category2,Category3 FROM `data_buildings` is invalid (Error 1054: Unknown column 'Tier' in 'SELECT' Function: EDConnectorRdbms::fetch Query: SELECT Name,Tier,Description,JourneyRequirement,Health,PowerCost,GeneratesPower,StorageSlots,StorageVolume,RecipeToBuild,PlacedWith,ImageFile,AdditionalNotes,YoutubeURL,Category1,Category2,Category3 FROM `data_buildings` ).



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).
           The query SELECT  Refiner,Output,Ingredients,Time,Recipe  FROM `data_refining_recipes`      is invalid (Error 1146: Table 'dunedbco_ddb.data_refining_recipes' doesn't exist

Function: EDConnectorRdbms::fetch Query: SELECT Refiner,Output,Ingredients,Time,Recipe FROM `data_refining_recipes` ).

Additional Information
Notes
{{{AdditionalNotes}}}
VIDEO TUTORIALS
            Building Guide
           Coming Soon
RELATED BUILDINGS
           🏗 Other {{{Category3}}}
           Explore similar building types to expand your base capabilities.
           The query SELECT  Name,Tier,Description,ImageFile,Category3  FROM `data_buildings`      is invalid (Error 1054: Unknown column 'Tier' in 'SELECT'

Function: EDConnectorRdbms::fetch Query: SELECT Name,Tier,Description,ImageFile,Category3 FROM `data_buildings` ).