Jump to content

Need help with a sub Menu please


Zola

Recommended Posts

Hey

 

I have a menu in place that works well on a website I am building. I use a php include so that the menu is served up the same over all the pages, nice and easy for updates etc.

 

I felt it was important to have an indicator on the selected menu item to reassure the user what page they are on.

 

Heres a code snippet of how I did this this. Using the .selected class in CSS  I simply changed the colour of the item.

<ul class="menu">
      <li><a href='index.php' <?php if( $page == 'index') echo 'class="selected"'?> ><span>Home</span></a></li>
       </ul>

I have another sub menu on a few pages that categories some content (I want these items to be on 6-7 pages). How could I do the same thing as above for these?

 

As you can see below, I already have a class name for these items, as I wanted them appear as a button I made.

    <a href="sub_item.php" class="icons_button"><i class="icon-tablet"> </i> Sub Item Example</a>
Link to comment
https://forums.phpfreaks.com/topic/282866-need-help-with-a-sub-menu-please/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.