NavBar & SideBar Works... Kinda. Not Customized Yet.
This commit is contained in:
@@ -1,8 +1,32 @@
|
||||
<aside id="sidebar" class="sidebar">
|
||||
<ul class="sidebar__list">
|
||||
<li><a href="#" class="sidebar__link"><span>🏠</span> <span class="link-text">Dashboard</span></a></li>
|
||||
<li><a href="#" class="sidebar__link"><span>📦</span> <span class="link-text">Inventory</span></a></li>
|
||||
<li><a href="#" class="sidebar__link"><span>⚖️</span> <span class="link-text">Auction House</span></a></li>
|
||||
<li><a href="#" class="sidebar__link"><span>⚙️</span> <span class="link-text">Settings</span></a></li>
|
||||
</ul>
|
||||
</aside>
|
||||
<?php global $current_file, $active_profession_title; ?>
|
||||
<?php
|
||||
// Skip rendering the sidebar if we are on the homepage
|
||||
if (!empty($active_profession) && $active_profession !== 'index'):
|
||||
|
||||
// 2. Define the static utilities/tools every profession uses
|
||||
$sidebar_tools = [
|
||||
'ingredients' => ['Supplies Needed', 'profession_supplies.php'],
|
||||
'market' => ['Current Market Prices', 'profession_market.php'],
|
||||
'leveling' => ['Leveling Guide', 'profession_leveling.php'],
|
||||
];
|
||||
?>
|
||||
<aside class="sidebar" aria-label="<?= htmlspecialchars($active_profession_title) ?> Tools">
|
||||
<h3 class="sidebar__title"><?= htmlspecialchars($active_profession_title) ?> Utilities</h3>
|
||||
<ul class="sidebar__list">
|
||||
<?php foreach ($sidebar_tools as $key => $tool_info): ?>
|
||||
<?php
|
||||
// Generate link like: profession_supplies.php?prof=blacksmithing
|
||||
$target_url = $tool_info[1] . '?prof=' . urlencode($active_profession);
|
||||
|
||||
// Check if this specific tool page is the one currently loaded
|
||||
$is_tool_active = ($current_file === $tool_info[1]) ? ' sidebar__link--active' : '';
|
||||
?>
|
||||
<li class="sidebar__item">
|
||||
<a href="<?= htmlspecialchars($target_url) ?>" class="sidebar__link<?= $is_tool_active ?>">
|
||||
<?= htmlspecialchars($tool_info[0]) ?>
|
||||
</a>
|
||||
</li>
|
||||
<?php endforeach; ?>
|
||||
</ul>
|
||||
</aside>
|
||||
<?php endif; ?>
|
||||
|
||||
Reference in New Issue
Block a user