Something like the following should have the desired effect (this is
butchered code from one of my themes - I've not tested it in this form):

---
<?php foreach ( $pages as $page ) : ?>
<li class="menu-item <?php echo ( isset( $post ) && $page->id == $post->id
) ? 'current-menu-item' : '' ?>"><a href="<?php echo $page->permalink;
?>"><?php echo $page->title; ?></a></li>
<?php endforeach; ?>
---

$pages is defined in my theme.php as follows:

---
public function add_template_vars()
{
if ( !$this->template_engine->assigned( 'pages' ) ) {
                $this->assign('pages', Posts::get( 'page_list' ) );
        }
[... the rest of the function's contents here ... ]
}
---

HTH
Colin


On Tue, Jun 12, 2012 at 9:33 PM, rustless <[email protected]> wrote:

> OK, I done this with one:
>
> *<li class="home<?php if ( $request->display_home ) : echo '
> current-menu-item'; endif; ?>"><a href="<?php Site::out_url( 'habari' );
> ?>"><span>Home</span></a></li>*
>
> But what I should do with *pages*? Help, please... (sorry for my English)
>
> вторник, 12 июня 2012 г., 20:28:16 UTC+4 пользователь rustless написал:
>
>> Hi! I'am creating theme for Habari, this is navigation:
>>
>> *<ul class="topmenu">
>> <li class="home current-menu-item"><a href="<?php
>> Site::out_url( 'habari' ); ?>"><span>Home</span></a></li>
>> </ul> *
>>
>> There are li class "home current-menu-item", but when user on
>> nonhomepage, I want li class to be simply "home". How to do it?
>> Thanks!!!
>
>  --
> To post to this group, send email to [email protected]
> To unsubscribe from this group, send email to
> [email protected]
> For more options, visit this group at
> http://groups.google.com/group/habari-users
>



-- 
Colin Seymour
Blog: http://colinseymour.co.uk
Tech Stuff: http://lildude.co.uk
Barefoot Running: http://barefootrunner.co.uk
IRC: lildude #habari

-- 
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/habari-users

Reply via email to