Actions

Template

ResourcePage: Difference between revisions

From Dune Awakening DB

mNo edit summary
mNo edit summary
 
(11 intermediate revisions by the same user not shown)
Line 1: Line 1:
<includeonly>
<templatestyles src="Template:ResourcePage/styles.css" />{{#get_external_data:source=externaldb|from=data_items|data=ItemID=item_id,InternalName=internal_name,ItemClass=item_class,ItemSubclass=item_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,GuideLink=guide_link,IconLink=icon_link,ImageLink=image_link,Category1=category_1,Category2=category_2,Category3=category_3|cache=yes|where=name='{{PAGENAME}}'|limit=1
<div class="dune-breadcrumb-nav">
}}
<templatestyles src="Template:ResourcePage/styles.css" />
{{#for_external_table:|{{#vardefine:ItemID|{{{ItemID}}}}}{{#vardefine:InternalName|{{{InternalName}}}}}{{#vardefine:ItemClass|{{{ItemClass}}}}}{{#vardefine:ItemSubclass|{{{ItemSubclass}}}}}{{#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:GuideLink|{{{GuideLink}}}}}{{#vardefine:IconLink|{{{IconLink}}}}}{{#vardefine:ImageLink|{{{ImageLink}}}}}{{#vardefine:Category1|{{{Category1}}}}}{{#vardefine:Category2|{{{Category2}}}}}{{#vardefine:Category3|{{{Category3}}}}}
 
  }}
<!-- ───── 1. MAIN ITEM LOOKUP ───── -->
<div class="responsive-container">
<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:ItemClass}} - {{#var:ItemSubclass}}</div>
<div class="dune-card-title"><span class="icon">◆</span> Resource Information</div>
<div style="padding:3px;"></div>
<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>
<div class="dune-card-description">{{#invoke:DataTableParserV2|iconize|{{#var:Description}}}}</div>
<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>
{{#get_external_data:
{{#get_external_data:
  source=externaldb
source=externaldb
  |from=data_items
|from=data_item_locations
  |data=ItemID=item_id,InternalName=internal_name,ResourceClass=resource_class,
|data=LocationName=location_name,Note=note
        ResourceSubclass=resource_subclass,Tier=tier,Rarity=rarity,Faction=faction,
|cache=yes
        Name=name,Description=description,HowToObtain=how_to_obtain,Notes=notes,
|where=internal_name='{{PAGENAME}}'
        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}}
  |limit=1
  |cache=yes
}}
}}
{{#for_external_table:|
{{#if:{{{LocationName|}}}|<div style="clear:both; padding:10px;"></div><div class="dune-card-title"><span class="icon">🗺</span> Harvest Locations</div><div style="padding:3px;"></div><div class="dune-card-description"><ul class="location-list">{{#for_external_table:|<li>'''{{{LocationName}}}'''{{#if:{{{Note|}}}|: {{{Note}}}}}</li>}}</ul></div>}}
  {{#vardefine:ItemID|{{{ItemID}}}}}{{#vardefine:InternalName|{{{InternalName}}}}}
</div>
  {{#vardefine:ResourceClass|{{{ResourceClass}}}}}{{#vardefine:ResourceSubclass|{{{ResourceSubclass}}}}}
</div>
  {{#vardefine:Tier|{{{Tier}}}}}{{#vardefine:Rarity|{{{Rarity}}}}}{{#vardefine:Faction|{{{Faction}}}}}
</div>
  {{#vardefine:Name|{{{Name}}}}}{{#vardefine:Description|{{{Description}}}}}
</div>
  {{#vardefine:HowToObtain|{{{HowToObtain}}}}}{{#vardefine:Notes|{{{Notes}}}}}
<div class="responsive-col col2">
  {{#vardefine:AdditionalNotes|{{{AdditionalNotes}}}}}{{#vardefine:Weight|{{{Weight}}}}}
<div class="skin-pivot">
  {{#vardefine:MaxStacks|{{{MaxStacks}}}}}{{#vardefine:XPPerHarvest|{{{XPPerHarvest}}}}}
<div class="dune-card">
  {{#vardefine:BaseVendorPrice|{{{BaseVendorPrice}}}}}{{#vardefine:LocationsToHarvest|{{{LocationsToHarvest}}}}}
<div class="dune-card-decoration"></div>
  {{#vardefine:GuideLink|{{{GuideLink}}}}}{{#vardefine:IconLink|{{{IconLink}}}}}
<div class="dune-card-inner">
  {{#vardefine:ImageLink|{{{ImageLink}}}}}{{#vardefine:Category1|{{{Category1}}}}}
<div class="dune-card-label">CRAFTING</div>
  {{#vardefine:Category2|{{{Category2}}}}}{{#vardefine:Category3|{{{Category3}}}}}
<div class="dune-card-title"><span class="icon">⚒</span> Crafting Recipes</div>
<div style="padding:3px;"></div>
<div class="crafting-section">
<h3 class="dune-section-header">Crafted With</h3>
<div class="dune-card-description">Items that require {{#var:Name}} as an ingredient</div>
<div id="craftedWithPreview" class="recipe-table-preview">
{{#get_external_data:
source=externaldb
|from=vw_recipe_by_ingredient
|data=OutputItem=output_item,Resources=resources,Stations=stations
|cache=yes
|where=ingredient='{{PAGENAME}}'
|order by=Stations
|limit=5
|table=crafted_with_preview
}}
}}
 
<!-- For Crafted With section, after the table -->
<!-- Breadcrumb -->
<div class="crafted-with-full-data" style="display:none;">
<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">
 
<!-- ───── 2. LEFT COLUMN (unchanged) ───── -->
… <!-- everything here stays exactly as you already have it -->
 
 
<!-- ───── 3. “CRAFTED WITH” PREVIEW ───── -->
{{#get_external_data:
{{#get_external_data:
  source = externaldb
source=externaldb
  |from = data_recipe_ingredients
|from=vw_recipe_by_ingredient
          JOIN data_recipes        ON data_recipe_ingredients.recipe_id = data_recipes.id
|data=OutputItem=output_item,Resources=resources,Stations=stations,WaterML=water_ml,CraftTime=craft_time,Schematic=schematic
          JOIN data_recipe_stations ON data_recipes.id                    = data_recipe_stations.recipe_id
|format=json
  |data = OutputItem = primary_output_label,
|cache=yes
          Resources = GROUP_CONCAT(\DISTINCT CONCAT(
|where=ingredient='{{PAGENAME}}'
                          ingredient_label\, CHAR(32)\, CHAR(120)\, amount
|order by=Stations
                        ) SEPARATOR CHAR(59)),
          Stations  = GROUP_CONCAT(\DISTINCT production_type SEPARATOR CHAR(59))
  |where = ingredient_label = {{PAGENAME}}
  |group by = primary_output_label
  |order by = primary_output_label
  |limit = 5          <!-- preview size -->
  |cache = yes
}}
}}
 
</div>
 
<div class="dune-table-wrapper">
<div class="dune-table-wrapper">
<table class="infobox-dune-standard-table recipe-table" id="craftedWithTable">
<table class="infobox-dune-standard-table recipe-table" id="craftedWithTable">
  <thead><tr class="tr-dark">
<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>
    <th style="width:35%;">Item Created</th>
{{#for_external_table:|<tr class="recipe-row"><td>{{#invoke:DataTableParserV2|iconize|{{{OutputItem}}}}}</td><td>{{#invoke:DataTableParserV2|formatRecipeList|{{{Resources}}}}}</td><td>{{{Stations}}}</td></tr>}}
    <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>
</table>
</div>
</div>
 
</div>
 
<div class="recipe-actions"><span class="dune-action-button view-all-crafted-with" data-resource="{{PAGENAME}}">View All Recipes</span></div>
<!-- ───── 4. “CRAFTED FROM” PREVIEW ───── -->
</div>
<div style="clear:both; padding:10px;"></div>
<div class="crafting-section">
<h3 class="dune-section-header">Crafted From</h3>
<div class="dune-card-description">Recipes that produce {{#var:Name}}</div>
<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
}}
<!-- For Crafted From section, after the table -->
<div class="crafted-from-full-data" style="display:none;">
{{#get_external_data:
{{#get_external_data:
  source = externaldb
source=externaldb
  |from = data_recipe_outcomes
|from=vw_recipe_summary
          JOIN data_recipes            ON data_recipe_outcomes.recipe_id  = data_recipes.id
|data=OutputItem=output_item,Resources=resources,Stations=station,WaterML=water_ml,CraftTime=craft_time,Schematic=schematic
          JOIN data_recipe_ingredients ON data_recipes.id                = data_recipe_ingredients.recipe_id
|format=json
          JOIN data_recipe_stations    ON data_recipes.id                = data_recipe_stations.recipe_id
|cache=yes
  |data = OutputItem = output_label,
|where=output_item='{{PAGENAME}}'
          Resources = GROUP_CONCAT(\DISTINCT CONCAT(
|order by=station
                          ingredient_label\, CHAR(32)\, CHAR(120)\, amount
|table=crafted_from_preview
                        ) SEPARATOR CHAR(59)),
          Stations  = GROUP_CONCAT(\DISTINCT production_type SEPARATOR CHAR(59))
  |where = output_label = {{PAGENAME}}
  |group by = output_label
  |order by = output_label
  |limit = 5
  |cache = yes
}}
}}
 
</div>
 
<div class="dune-table-wrapper">
<div class="dune-table-wrapper">
<table class="infobox-dune-standard-table recipe-table" id="craftedFromTable">
<table class="infobox-dune-standard-table recipe-table" id="craftedFromTable">
  <thead><tr class="tr-dark">
<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>
    <th style="width:35%;">Item Created</th>
{{#for_external_table:|<tr class="recipe-row"><td>{{#invoke:DataTableParserV2|iconize|{{{OutputItem}}}}}</td><td>{{#invoke:DataTableParserV2|formatRecipeList|{{{Resources}}}}}</td><td>{{{Stations}}}</td></tr>}}
    <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>
</table>
</div>
</div>
 
</div>
 
<div class="recipe-actions"><span class="dune-action-button view-all-crafted-from" data-resource="{{PAGENAME}}">View All Recipes</span></div>
<!-- ───── 5. RIGHT COLUMN, POP-UP, ETC. (unchanged) ───── -->
</div>
… <!-- keep everything from here to the end exactly as in your current page -->
</div>
 
</div>
</div> <!-- .responsive-container -->
</div>
</includeonly>
</div>
 
<div class="responsive-col col3">
 
    <!-- Building Guide Video Card with Notes integrated -->
  <!-- Right Column: Resource Guide -->
  <div class="responsive-col col3">
     <div class="skin-pivot">
     <div class="skin-pivot">
       <div class="dune-card">
       <div class="dune-card">
Line 142: Line 128:
         <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">▶</span> Resource Guide</div>
           <div class="dune-card-title"><span class="icon">▶</span> Building Guide</div>
           <div style="padding:3px;"></div>
           <div style="padding:3px;"></div>
           <div class="dune-card-video" style="border:2px solid #e2d3ae;border-radius:4px;padding:2px;background-color:#262626;">  
           <div class="dune-card-video">
             {{#if:{{#var:GuideLink}}
             {{#if:{{{YoutubeEmbed|}}}|
               | <youtube>{{#var:GuideLink}}</youtube>
               {{{YoutubeEmbed}}}
               | <youtube>r8lxVDqoHLQ</youtube>}}
            |
               <youtube id="r8lxVDqoHLQ" />
            }}
           </div>
           </div>
         
           <div style="clear:both; padding:10px;"></div>
           <div style="clear:both; padding:10px;"></div>
         
 
          <!-- Notes Section -->
           <div class="dune-card-title"><span class="icon"></span> Notes</div>
           <div class="dune-card-title"><span class="icon"></span> Notes</div>
           <div style="padding:3px;"></div>
           <div style="padding:3px;"></div>
           <div class="dune-card-description">{{#invoke:DataTableParserV2|iconize|{{#var:AdditionalNotes}}}}</div>
           <div class="dune-card-description">{{#invoke:DataTableParserV2|iconize|{{#var:AdditionalNotes}}}}</div>
         
          {{#if:{{#var:LocationsToHarvest}}|
          <div style="clear:both; padding:10px;"></div>
          <!-- Harvest Locations -->
          <div class="dune-card-title"><span class="icon">🗺</span> Harvest Locations</div>
          <div style="padding:3px;"></div>
          <div class="dune-card-description">{{#invoke:DataTableParserV2|iconize|{{#var:LocationsToHarvest}}}}</div>
          |}}
         </div>
         </div>
       </div>
       </div>
     </div>
     </div>
  </div>
</div>
</div>


<!-- Recipe Popup Template -->
{{#tag:script|
<script id="recipePopupTemplate" type="text/template">
<nowiki>
  <div class="recipe-popup-overlay">
<div class="recipe-popup-overlay">
    <div class="recipe-popup">
  <div class="recipe-popup">
      <div class="popup-header">
    <div class="popup-header">
        <h3 class="popup-title">{{title}}</h3>
      <h3 class="popup-title">{{title}}</h3>
        <button class="popup-close">×</button>
      <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>
       <div class="popup-content">
       <div class="popup-table-wrapper">
        <div class="popup-search-container">
        <table class="infobox-dune-standard-table recipe-popup-table">
          <input type="text" class="popup-search-input" placeholder="Search recipes...">
          <thead>
        </div>
            <tr class="tr-dark">
        <div class="popup-table-wrapper">
              <th>Item Created</th><th>Resources Needed</th><th>Stations</th>
          <table class="infobox-dune-standard-table recipe-popup-table">
              <th>Water&nbsp;(mL)</th><th>Craft&nbsp;Time</th><th>Schematic</th>
            <thead>
            </tr>
              <tr class="tr-dark">
          </thead>
                <th>Item Created</th>
          <tbody>{{tableRows}}</tbody>
                <th>Resources Needed</th>
        </table>
                <th>Stations</th>
                <th>Water (mL)</th>
                <th>Craft Time</th>
                <th>Schematic</th>
              </tr>
            </thead>
            <tbody>
              {{tableRows}}
            </tbody>
          </table>
        </div>
       </div>
       </div>
     </div>
     </div>
   </div>
   </div>
</script>
</div>
</nowiki>
|type="text/template" id="recipePopupTemplate"}}

Latest revision as of 01:49, 4 June 2025

{{{ItemClass}}} - {{{ItemSubclass}}}
Resource Information
[[File:{{{ImageLink}}}|200px|alt={{{Name}}}]]
{{{Description}}}
[[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

Items that require {{{Name}}} as an ingredient
Item CreatedResources NeededStations
View All Recipes

Crafted From

Recipes that produce {{{Name}}}
Item CreatedResources NeededStations
View All Recipes
VIDEO TUTORIALS
Building Guide
Notes
{{{AdditionalNotes}}}

<script type="text/template" id="recipePopupTemplate"> <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>