Jump to content

Breadcrumbs + Active "Here" Link


chicobandito

Recommended Posts

Hello, I have 2 questions... :)

 

1. Do you know of any good and easy php breadcrumb solution?

 

2. I have recently learned how to use PHP to make a navigation Active based on what page I am on (see below).  If I am on the "currentPage" "contact.php" it will show it active...

But, what I also want to do is have the main nav active on a sub-nav page.  Is it possible to have 2 or more page referenced?  Something like ($currentPage == 'contact.php' AND 'contact_form.php')  Where both pages would make the link appear active and highlighted.

 

<ul>

<li><a href="contact.php" <?php if ($currentPage == 'contact.php') {echo 'id="here"';} ?>>Contact</a></li>

<li><a href="about.php" <?php if ($currentPage == 'about.php') {echo 'id="here"';} ?>>About Us</a></li>

<li><a href="careers.php" <?php if ($currentPage == 'careers.php') {echo 'id="here"';} ?>>Careers</a></li>

<li><a href="services.php" <?php if ($currentPage == 'services.php') {echo 'id="here"';} ?>>Services</a></li>

<li><a href="index.php" <?php if ($currentPage == 'index.php') {echo 'id="here"';} ?>>Home</a></li>

</ul>

 

Thank you in advance for your help :)

Link to comment
https://forums.phpfreaks.com/topic/250142-breadcrumbs-active-here-link/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.