Set selected item in an autonav

Permalink
I have a case where I need the ability to set the selected/current item in an autonav and was wondering if anyone had done this before.

What we have is this hierarchy of pages:

Venues (hidden)
- Venue A
- Venue B
Dining
Entertainment

There is an autonav at the top level (containing Dining, Entertainment).

When you are on the Venue A page, we want to highlight Dining (not Venues). I'm looking for a way to manually tell the autonav "select dining". Any ideas?

Thanks,
Blake

blakeage
 
blakeage replied on at Permalink Reply
blakeage
I'm not sure how clear my post was, so I'll clarify. I'm simply looking for a way to specify which item in an autonav is selected (has the nav-selected class). Any ideas?
mkly replied on at Permalink Reply
mkly
Hmm...
You can create a new autonav template with some custom code to highlight different.
You could add some jQuery/javascript with an .addClass() .removeClass()
I'm guessing most people are going to give you the "Why don't you just stick "Venue A" and "Venue B" under Dining?"
SkyBlueSofa replied on at Permalink Reply
SkyBlueSofa
Did you ever get this figured out?

I'm doing something similar with two pages. One called 'Companies' and one called 'Company' (which is hidden). I want to show a list of companies on the 'Companies' page, but when you click on one, the URL should show 'company/abc' instead of 'companies/abc', but the 'Companies' nav is highlighted.
blakeage replied on at Permalink Reply
blakeage
We just determined the section they were under in PHP, and then used some javascript to highlight the nav accordingly.
<script type="text/javascript">   
  $(function() {
    var lis = $(".nav").children();
    lis.each(function(index){
      if($(this).find("a").html() == "Dining & Cocktails") {
        $(this).attr("class", "nav-selected nav-path-selected");
        $(this).find("a").attr("class", "nav-selected nav-path-selected");
      }
    });
  });
</script>