Files
Portfolio-2026/views/components/menu-items/index.php
T
Keith Solomon b9bbf615c9
Deploy to Dreamhost / build (push) Skipped
Sync TODOs with Issues / sync_todos (push) Successful in 6s
🐞 fix: Fix mobile issues, enablke deploy on push #skipGA
2026-08-29 08:52:57 -05:00

47 lines
1.6 KiB
PHP

<?php
/**
* Main Navigation - Menu Items outer list
*
* Please review documentation upon first use, and, as-needed:
* https://docs.vincentdevelopment.ca/docs/starter-v3-enhancements/navigation/
*/
namespace KsPortfolio;
// Variables available from MenuItems component:
// $topLevelNavItems, $hasChildren, $nestedNavItems, $currentPage, $location
if ( $location === 'main_navigation' ) {
$menuID = 'menu-container';
} else {
$menuID = 'menu-container-aux';
}
// Resume link is exposed by header.php via $GLOBALS['ks_portfolio_link_resume']
// and read here so it can be appended as a mobile-only CTA at the bottom of
// the menu panel (hidden on desktop via lg:hidden).
$linkResume = isset( $GLOBALS['ks_portfolio_link_resume'] ) ? $GLOBALS['ks_portfolio_link_resume'] : '';
?>
<ul id="<?php echo esc_attr( $menuID ); ?>" class="menu-vdi">
<li class="menu-item menu-item--search px-4 lg:hidden">
<?php get_template_part( 'views/forms/search' ); ?>
</li>
<?php foreach ( $topLevelNavItems as $item ) : ?>
<?php if ( $hasChildren( $item ) ) : ?>
<?php include __DIR__ . '/has-children.php'; ?>
<?php else : ?>
<?php include __DIR__ . '/single.php'; ?>
<?php endif; ?>
<?php endforeach; ?>
<?php if ( ! empty( $linkResume ) && $location === 'main_navigation' ) : ?>
<li class="menu-vdi__item menu-item--resume lg:hidden border-t border-secondary-200 mt-2 pt-2">
<a href="<?php echo esc_url( $linkResume ); ?>" class="menu-vdi__link button button--primary mx-4 inline-block">
<?php echo esc_html__( 'Resume', 'ks-portfolio' ); ?>
</a>
</li>
<?php endif; ?>
</ul>