Actions

Template

ResourcePage: Difference between revisions

From Dune Awakening DB

mNo edit summary
mNo edit summary
Line 1: Line 1:
<includeonly>
<div class="dune-breadcrumb-nav">
<div class="dune-breadcrumb-nav">
<templatestyles src="Template:ResourcePage/styles.css" />
<templatestyles src="Template:ResourcePage/styles.css" />
{{#get_external_data:
{{#get_external_data:
   source = externaldb
   source=externaldb
   |from = data_items
   |from=data_items
   |data = ItemID=item_id,InternalName=internal_name,
   |data=ItemID=item_id,InternalName=internal_name,ResourceClass=resource_class,ResourceSubclass=resource_subclass,Tier=tier,Rarity=rarity,Faction=faction,Name=name,Description=description,HowToObtain=how_to_obtain,Notes=notes,AdditionalNotes=additional_notes,Weight=weight,MaxStacks=max_stacks,XPPerHarvest=xp_per_harvest,BaseVendorPrice=base_vendor_price,LocationsToHarvest=locations_to_harvest,GuideLink=guide_link,IconLink=icon_link,ImageLink=image_link,Category1=category_1,Category2=category_2,Category3=category_3
          ResourceClass=resource_class,ResourceSubclass=resource_subclass,
  |cache=yes
          Tier=tier,Rarity=rarity,Faction=faction,Name=name,
   |where=name='{{PAGENAME}}'
          Description=description,HowToObtain=how_to_obtain,
   |limit=1
          Notes=notes,AdditionalNotes=additional_notes,
          Weight=weight,MaxStacks=max_stacks,XPPerHarvest=xp_per_harvest,
          BaseVendorPrice=base_vendor_price,
          LocationsToHarvest=locations_to_harvest,
          GuideLink=guide_link,IconLink=icon_link,ImageLink=image_link,
          Category1=category_1,Category2=category_2,Category3=category_3
   |where = name = '{{PAGENAME}}'       <!-- ← quoted -->
   |limit = 1
  |cache = yes
}}
}}
{{#for_external_table:|
{{#for_external_table:|{{#vardefine:ItemID|{{{ItemID}}}}}{{#vardefine:InternalName|{{{InternalName}}}}}{{#vardefine:ResourceClass|{{{ResourceClass}}}}}{{#vardefine:ResourceSubclass|{{{ResourceSubclass}}}}}{{#vardefine:Tier|{{{Tier}}}}}{{#vardefine:Rarity|{{{Rarity}}}}}{{#vardefine:Faction|{{{Faction}}}}}{{#vardefine:Name|{{{Name}}}}}{{#vardefine:Description|{{{Description}}}}}{{#vardefine:HowToObtain|{{{HowToObtain}}}}}{{#vardefine:Notes|{{{Notes}}}}}{{#vardefine:AdditionalNotes|{{{AdditionalNotes}}}}}{{#vardefine:Weight|{{{Weight}}}}}{{#vardefine:MaxStacks|{{{MaxStacks}}}}}{{#vardefine:XPPerHarvest|{{{XPPerHarvest}}}}}{{#vardefine:BaseVendorPrice|{{{BaseVendorPrice}}}}}{{#vardefine:LocationsToHarvest|{{{LocationsToHarvest}}}}}{{#vardefine:GuideLink|{{{GuideLink}}}}}{{#vardefine:IconLink|{{{IconLink}}}}}{{#vardefine:ImageLink|{{{ImageLink}}}}}{{#vardefine:Category1|{{{Category1}}}}}{{#vardefine:Category2|{{{Category2}}}}}{{#vardefine:Category3|{{{Category3}}}}} }}
  <!-- all your #vardefine lines stay exactly the same -->
<!-- Breadcrumb navigation -->
  {{#vardefine:ItemID|{{{ItemID}}}}}{{#vardefine:InternalName|{{{InternalName}}}}}
{{#if:{{{AdditionalNotes|}}}
  {{#vardefine:ResourceClass|{{{ResourceClass}}}}}{{#vardefine:ResourceSubclass|{{{ResourceSubclass}}}}}
| {{#vardefine:AdditionalNotes|{{{AdditionalNotes}}}}}
  {{#vardefine:Tier|{{{Tier}}}}}{{#vardefine:Rarity|{{{Rarity}}}}}{{#vardefine:Faction|{{{Faction}}}}}
| <!-- fallback already set inside external data loop -->
  {{#vardefine:Name|{{{Name}}}}}{{#vardefine:Description|{{{Description}}}}}
  {{#vardefine:HowToObtain|{{{HowToObtain}}}}}{{#vardefine:Notes|{{{Notes}}}}}
  {{#vardefine:AdditionalNotes|{{{AdditionalNotes}}}}}{{#vardefine:Weight|{{{Weight}}}}}
  {{#vardefine:MaxStacks|{{{MaxStacks}}}}}{{#vardefine:XPPerHarvest|{{{XPPerHarvest}}}}}
  {{#vardefine:BaseVendorPrice|{{{BaseVendorPrice}}}}}{{#vardefine:LocationsToHarvest|{{{LocationsToHarvest}}}}}
  {{#vardefine:GuideLink|{{{GuideLink}}}}}{{#vardefine:IconLink|{{{IconLink}}}}}
  {{#vardefine:ImageLink|{{{ImageLink}}}}}{{#vardefine:Category1|{{{Category1}}}}}
  {{#vardefine:Category2|{{{Category2}}}}}{{#vardefine:Category3|{{{Category3}}}}}
}}
}}
<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>


<!-- Breadcrumbs and left-column markup unchanged … -->
<div class="responsive-container">
  <!-- Left Column: Resource Information -->
  <div class="responsive-col col1">
    <div class="skin-pivot">
      <div class="dune-card">
        <div class="dune-card-decoration"></div>
        <div class="dune-card-inner">
          <div class="dune-card-label">{{#var:ResourceClass}} - {{#var:ResourceSubclass}}</div>
          <div class="dune-card-title"><span class="icon">◆</span> Resource Information</div>
          <div style="padding:3px;"></div>
          <!-- Image Section -->
          <div class="dune-card-image" style="text-align: center;">
            <div class="has-border">{{#if:{{#var:ImageLink}}| [[File:{{#var:ImageLink}}|200px|alt={{#var:Name}}]] | [[File:Placeholder.png|200px|alt=No image available]]}}
            </div>
          </div>
          <div style="padding:3px;"></div>
          <!-- Description -->
          <div class="dune-card-description">{{#invoke:DataTableParserV2|iconize|{{#var:Description}}}}</div>
          <!-- How to Obtain -->
          {{#if:{{#var:HowToObtain}}|
          <div class="dune-card-locked">
            <div class="dune-card-locked-label"><span class="dune-card-locked-icon">📍</span>How to Obtain</div>
            <div class="dune-card-locked-value">{{#var:HowToObtain}}</div>
          </div>
          |}}
          <!-- Resource Stats Table -->
          <div class="dune-table-wrapper">
            <table class="infobox-dune-two-column">
              <tr><th><span class="icon">{{#if:{{#var:IconLink}}|[[File:{{#var:IconLink}}|16px]]|}}</span> Tier</th><td>{{#var:Tier}}</td></tr>
              <tr><th><span class="icon">✦</span> Rarity</th><td>{{#var:Rarity}}</td></tr>
              <tr><th><span class="icon">🏛</span> Faction</th><td>{{#var:Faction}}</td></tr>
              <tr><th><span class="icon">⚖</span> Weight</th><td>{{#var:Weight}} kg</td></tr>
              <tr><th><span class="icon">📦</span> Max Stacks</th><td>{{#var:MaxStacks}}</td></tr>
              <tr><th><span class="icon">💰</span> Base Vendor Price</th><td>{{#var:BaseVendorPrice}} Solaris</td></tr>
              <tr><th><span class="icon">⭐</span> XP per Harvest</th><td>{{#var:XPPerHarvest}}</td></tr>
            </table>
          </div>
        </div>
      </div>
    </div>
  </div>


<!-- ========= CRAFTED WITH THIS RESOURCE (ingredient) ========= -->
  <!-- Middle Column: Crafting Recipes -->
{{#get_external_data:
  <div class="responsive-col col2">
  source = externaldb
    <div class="skin-pivot">
  |from = vw_recipe_by_ingredient
      <div class="dune-card">
  |data = OutputItem = output_item,
        <div class="dune-card-decoration"></div>
          Resources = resources,
        <div class="dune-card-inner">
          Stations   = stations
          <div class="dune-card-label">CRAFTING</div>
  |where = ingredient = '{{PAGENAME}}'
          <div class="dune-card-title"><span class="icon">⚒</span> Crafting Recipes</div>
  |order by = Stations
          <div style="padding:3px;"></div>
  |limit = 5
          <!-- Crafted With Section -->
  |cache = yes
          <div class="crafting-section">
}}
            <h3 class="dune-section-header">Crafted With This Resource</h3>
<div class="dune-table-wrapper">
            <div class="dune-card-description">Items that require {{#var:Name}} as an ingredient</div>
<table class="infobox-dune-standard-table recipe-table" id="craftedWithTable">
            <!-- Quick Search -->
  <thead>
            <div class="recipe-search-container">
    <tr class="tr-dark">
              <input type="text" id="craftedWithSearch" class="recipe-search-input" placeholder="Search recipes...">
      <th style="width:35%;">Item Created</th>
            </div>
      <th style="width:40%;">Resources Needed</th>
            <!-- Crafted With Table Preview -->
      <th style="width:25%;">Stations</th>
            <div id="craftedWithPreview" class="recipe-table-preview">
    </tr>
              {{#get_external_data:
  </thead>
                source=externaldb
  <tbody>
                |from=vw_recipe_by_ingredient
{{#for_external_table:|
                |data=OutputItem=output_item,Resources=resources,Stations=stations
    <tr class="recipe-row">
                |cache=yes
      <td>{{#invoke:DataTableParserV2|iconize|{{{OutputItem}}}}}</td>
                |where=ingredient='{{PAGENAME}}'
      <td>{{#invoke:DataTableParserV2|formatRecipeList|{{{Resources}}}}}</td>
                |order by=Stations
      <td>{{{Stations}}}</td>
                |limit=5
    </tr>
              }}
}}
              <div class="dune-table-wrapper">
  </tbody>
                <table class="infobox-dune-standard-table recipe-table" id="craftedWithTable">
</table>
                  <thead>
</div>
                    <tr class="tr-dark">
                      <th style="width:35%;">Item Created</th>
                      <th style="width:40%;">Resources Needed</th>
                      <th style="width:25%;">Stations</th>
                    </tr>
                  </thead>
                  <tbody>
                    {{#for_external_table:|
                      <tr class="recipe-row">
                        <td>{{#invoke:DataTableParserV2|iconize|{{{OutputItem}}}}}</td>
                        <td>{{#invoke:DataTableParserV2|formatRecipeList|{{{Resources}}}}}</td>
                        <td>{{{Stations}}}</td>
                      </tr>
                    }}
                  </tbody>
                </table>
              </div>
            </div>
            <!-- View All Button -->
            <div class="recipe-actions">
              <button class="dune-action-button view-all-crafted-with" data-resource="{{PAGENAME}}">
                <span class="icon">📋</span> View All Recipes
              </button>
            </div>
          </div>
          <div style="clear:both; padding:10px;"></div>
          <!-- Crafted From Section -->
          <div class="crafting-section">
            <h3 class="dune-section-header">Crafted From</h3>
            <div class="dune-card-description">Recipes that produce {{#var:Name}}</div>
            <!-- Quick Search -->
            <div class="recipe-search-container">
              <input type="text" id="craftedFromSearch" class="recipe-search-input" placeholder="Search recipes...">
            </div>
            <!-- Crafted From Table Preview -->
            <div id="craftedFromPreview" class="recipe-table-preview">
              {{#get_external_data:
                source=externaldb
                |from=vw_recipe_summary
                |data=OutputItem=output_item,Resources=resources,Stations=station,WaterML=water_ml,CraftTime=craft_time,Schematic=schematic
                |cache=yes
                |where=output_item='{{PAGENAME}}'
                |order by=station
                |limit=5
              }}
              <div class="dune-table-wrapper">
                <table class="infobox-dune-standard-table recipe-table" id="craftedFromTable">
                  <thead>
                    <tr class="tr-dark">
                      <th style="width:35%;">Item Created</th>
                      <th style="width:40%;">Resources Needed</th>
                      <th style="width:25%;">Stations</th>
                    </tr>
                  </thead>
                  <tbody>
                    {{#for_external_table:|
                      <tr class="recipe-row">
                        <td>{{#invoke:DataTableParserV2|iconize|{{{OutputItem}}}}}</td>
                        <td>{{#invoke:DataTableParserV2|formatRecipeList|{{{Resources}}}}}</td>
                        <td>{{{Stations}}}</td>
                      </tr>
                    }}
                  </tbody>
                </table>
              </div>
            </div>
            <!-- View All Button -->
            <div class="recipe-actions">
              <button class="dune-action-button view-all-crafted-from" data-resource="{{PAGENAME}}">
                <span class="icon">📋</span> View All Recipes
              </button>
            </div>
          </div>
        </div>
      </div>
    </div>
  </div>


<!-- ========= CRAFTED FROM (output recipes) ========= -->
  <!-- Right Column: Resource Guide -->
{{#get_external_data:
   <div class="responsive-col col3">
   source = externaldb
    <div class="skin-pivot">
  |from  = vw_recipe_summary
      <div class="dune-card">
  |data  = OutputItem = output_item,
        <div class="dune-card-decoration"></div>
          Resources  = resources,
        <div class="dune-card-inner">
          Stations  = station,
          <div class="dune-card-label">VIDEO TUTORIALS</div>
          WaterML    = water_ml,
          <div class="dune-card-title"><span class="icon">▶</span> Resource Guide</div>
          CraftTime  = craft_time,
          <div style="padding:3px;"></div>
          Schematic  = schematic
          <div class="dune-card-video" style="border:2px solid #e2d3ae;border-radius:4px;padding:2px;background-color:#262626;">  
  |where = output_item = '{{PAGENAME}}'
            {{#if:{{#var:GuideLink}}
  |order by = station
              | <youtube>{{#var:GuideLink}}</youtube>
  |limit = 5
              | <youtube>r8lxVDqoHLQ</youtube>}}
  |cache = yes
          </div>
}}
          <div style="clear:both; padding:10px;"></div>
<div class="dune-table-wrapper">
          <!-- Notes Section -->
<table class="infobox-dune-standard-table recipe-table" id="craftedFromTable">
          <div class="dune-card-title"><span class="icon">≡</span> Notes</div>
  <thead>
          <div style="padding:3px;"></div>
    <tr class="tr-dark">
          <div class="dune-card-description">{{#invoke:DataTableParserV2|iconize|{{#var:AdditionalNotes}}}}</div>
      <th style="width:35%;">Item Created</th>
          {{#if:{{#var:LocationsToHarvest}}|
      <th style="width:40%;">Resources Needed</th>
          <div style="clear:both; padding:10px;"></div>
      <th style="width:25%;">Stations</th>
          <!-- Harvest Locations -->
    </tr>
          <div class="dune-card-title"><span class="icon">🗺</span> Harvest Locations</div>
  </thead>
          <div style="padding:3px;"></div>
  <tbody>
          <div class="dune-card-description">{{#invoke:DataTableParserV2|iconize|{{#var:LocationsToHarvest}}}}</div>
{{#for_external_table:|
          |}}
    <tr class="recipe-row">
        </div>
      <td>{{#invoke:DataTableParserV2|iconize|{{{OutputItem}}}}}</td>
      </div>
      <td>{{#invoke:DataTableParserV2|formatRecipeList|{{{Resources}}}}}</td>
    </div>
      <td>{{{Stations}}}</td>
  </div>
    </tr>
}}
  </tbody>
</table>
</div>
</div>


<!-- right-column & popup markup stay unchanged … -->
<!-- Recipe Popup Template -->
</includeonly>
<script id="recipePopupTemplate" type="text/template">
  <div class="recipe-popup-overlay">
    <div class="recipe-popup">
      <div class="popup-header">
        <h3 class="popup-title">{{title}}</h3>
        <button class="popup-close">×</button>
      </div>
      <div class="popup-content">
        <div class="popup-search-container">
          <input type="text" class="popup-search-input" placeholder="Search recipes...">
        </div>
        <div class="popup-table-wrapper">
          <table class="infobox-dune-standard-table recipe-popup-table">
            <thead>
              <tr class="tr-dark">
                <th>Item Created</th>
                <th>Resources Needed</th>
                <th>Stations</th>
                <th>Water (mL)</th>
                <th>Craft Time</th>
                <th>Schematic</th>
              </tr>
            </thead>
            <tbody>
              {{tableRows}}
            </tbody>
          </table>
        </div>
      </div>
    </div>
  </div>
</script>

Revision as of 23:14, 26 May 2025

The query SELECT item_id,internal_name,resource_class,resource_subclass,tier,rarity,faction,name,description,how_to_obtain,notes,additional_notes,weight,max_stacks,xp_per_harvest,base_vendor_price,locations_to_harvest,guide_link,icon_link,image_link,category_1,category_2,category_3 FROM `data_items` WHERE name='ResourcePage' LIMIT 1 is invalid (Error 1054: Unknown column 'resource_class' in 'SELECT' Function: EDConnectorRdbms::fetch Query: SELECT item_id,internal_name,resource_class,resource_subclass,tier,rarity,faction,name,description,how_to_obtain,notes,additional_notes,weight,max_stacks,xp_per_harvest,base_vendor_price,locations_to_harvest,guide_link,icon_link,image_link,category_1,category_2,category_3 FROM `data_items` WHERE name='ResourcePage' LIMIT 1 ).


Menu/[[{{{Category1}}}|{{{Category1}}}]]/[[{{{Category2}}}|{{{Category2}}}]]/[[{{{Category3}}}|{{{Category3}}}]]/ResourcePage

{{{ResourceClass}}} - {{{ResourceSubclass}}}
Resource Information
[[File:{{{ImageLink}}}|200px|alt={{{Name}}}]]
{{{Description}}}
📍How to Obtain
{{{HowToObtain}}}
[[File:{{{IconLink}}}|16px]] Tier{{{Tier}}}
Rarity{{{Rarity}}}
🏛 Faction{{{Faction}}}
Weight{{{Weight}}} kg
📦 Max Stacks{{{MaxStacks}}}
💰 Base Vendor Price{{{BaseVendorPrice}}} Solaris
XP per Harvest{{{XPPerHarvest}}}
CRAFTING
Crafting Recipes

Crafted With This Resource

Items that require {{{Name}}} as an ingredient
             <input type="text" id="craftedWithSearch" class="recipe-search-input" placeholder="Search recipes...">
<thead> </thead> <tbody> </tbody>
Item Created Resources Needed Stations
             <button class="dune-action-button view-all-crafted-with" data-resource="ResourcePage">
               📋 View All Recipes
             </button>

Crafted From

Recipes that produce {{{Name}}}
             <input type="text" id="craftedFromSearch" class="recipe-search-input" placeholder="Search recipes...">
<thead> </thead> <tbody> </tbody>
Item Created Resources Needed Stations
             <button class="dune-action-button view-all-crafted-from" data-resource="ResourcePage">
               📋 View All Recipes
             </button>
VIDEO TUTORIALS
Resource Guide
           Provided ID could not be validated.
Notes
{{{AdditionalNotes}}}
🗺 Harvest Locations
{{{LocationsToHarvest}}}

<script id="recipePopupTemplate" type="text/template">

</script>