missing the default "first" class in auto-nav

Permalink
Hi,

I'm having problems with the auto-nav on my homepage.
I have a css style for the first menu-item that differs from the rest.
I read that the class="first" by default is implemented in de auto-nav block. But the html output is not showing the "first" class.

What I have done:

1. made a home.php template

2. this code in it:
<div id="headerNav">
        <?php
          $bt = BlockType::getByHandle('autonav');
          $bt->controller->displayPages = 'top';
          $bt->controller->orderBy = 'display_asc';
          $bt->render('view');
         ?>
     </div>


3. Html - output:
<div id="headerNav">
    <ul class="nav">
      <li class="nav-selected nav-path-selected">
      <a class="nav-selected nav-path-selected" href="/aandacht/">Home</a>
      </li>
      <li>
      <li>
    </ul>
</div>


The plain yoguht template has:
<li class="nav-selected first">


Can someone help me with this? I just don't know what I'm doing wrong. What is the reason the "first" class is missing?

Thanks in advance,
Mirjam

mirjamk
 
jordanlev replied on at Permalink Best Answer Reply
jordanlev
The plain yogurt theme uses the "header_menu" template for the autonav block, which has different HTML output than the default "view" template (which is what you're calling in your own code).

I've made a custom template for the autonav block that is much easier to style and add classes to in case you're interested:
https://raw.github.com/jordanlev/c5_clean_block_templates/master/aut...

To use it, you need to save that page as "view.php", then create a new folder called "autonav" in your site's top-level "blocks" directory (NOT concrete/blocks), then move the view.php file you downloaded into that new autonav folder.

-Jordan
mirjamk replied on at Permalink Reply
mirjamk
Hi Jordan,

Thank you very much!!!

This is really a great script. You have very much good work done for designers and made free Add-Ons. I use C5 just for a week and I noticed your good quality of work on the C5 site.

Regards,
Mirjam