I have an ASP page with the following include:
<!-- #include virtual="/_includes/main_nav.inc.asp" -->
main_nav.inc.asp contains:
<ul>
<li><a href="/About-Us/">About Us</a></li>
<li><a href="/Contact-Us/">ContactUs</a></li>
</ul>
When I use the include on the About Us page, the code displayed should be:
<ul>
<li class="on"><a href="/About-Us/">About Us</a></li>
<li><a href="/Contact-Us/">ContactUs</a></li>
</ul>
What's the best way to do this?
Using PHP, I can accomplish this using:
<?php $on="About Us"; include("/_includes/main_nav.inc.php"); ?>
Where main_nav.inc.php looks like:
<ul>
<li<? if($page_on=="About Us"){ echo class="on"; }?>><a href="/About-Us/">About Us</a></li>
<li><a href="/Contact-Us/">ContactUs</a></li>
</ul>
Basically, the About Us page will only have the class="on" when the include file contains a variable named $page_on that is equal to "About Us"
Also, if it makes a difference, maybe I ASP has a way to grab the folder name, and check if folder name == "About-Us"