fix: all service pages showing doble_nacionalidad content
The foreach loop in header.php used $slug and $servicio as loop variables, which overwrote the same-named variables set by servicio.php. After the loop, both variables held the last service (doble_nacionalidad), so every service page rendered that content. Renamed loop variables to $_nav_slug and $_nav_srv to avoid collision. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -42,11 +42,11 @@
|
|||||||
<ul class="navbar__dropdown">
|
<ul class="navbar__dropdown">
|
||||||
<?php
|
<?php
|
||||||
require_once __DIR__ . '/servicios-data.php';
|
require_once __DIR__ . '/servicios-data.php';
|
||||||
foreach ($SERVICIOS as $slug => $servicio): ?>
|
foreach ($SERVICIOS as $_nav_slug => $_nav_srv): ?>
|
||||||
<li>
|
<li>
|
||||||
<a href="servicio.php?s=<?= htmlspecialchars($slug) ?>" class="navbar__dropdown-link">
|
<a href="servicio.php?s=<?= htmlspecialchars($_nav_slug) ?>" class="navbar__dropdown-link">
|
||||||
<i class="fa-solid <?= htmlspecialchars($servicio['icono']) ?>"></i>
|
<i class="fa-solid <?= htmlspecialchars($_nav_srv['icono']) ?>"></i>
|
||||||
<?= htmlspecialchars($servicio['nombre']) ?>
|
<?= htmlspecialchars($_nav_srv['nombre']) ?>
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
<?php endforeach; ?>
|
<?php endforeach; ?>
|
||||||
|
|||||||
Reference in New Issue
Block a user