Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Current Page Item
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  3 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
rustless  
View profile  
 More options Jun 12 2012, 12:28 pm
From: rustless <rustless....@gmail.com>
Date: Tue, 12 Jun 2012 09:28:16 -0700 (PDT)
Local: Tues, Jun 12 2012 12:28 pm
Subject: Current Page Item
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!!!


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
rustless  
View profile   Translate to Translated (View Original)
 More options Jun 12 2012, 4:33 pm
From: rustless <rustless....@gmail.com>
Date: Tue, 12 Jun 2012 13:33:22 -0700 (PDT)
Local: Tues, Jun 12 2012 4:33 pm
Subject: Re: Current Page Item

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 написал:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Colin  
View profile  
 More options Jun 13 2012, 5:10 am
From: Colin <lild...@gmail.com>
Date: Wed, 13 Jun 2012 10:10:09 +0100
Local: Wed, Jun 13 2012 5:10 am
Subject: Re: [habari-users] Re: Current Page Item

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

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

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »