SitePoint Sponsor

User Tag List

Results 1 to 5 of 5

Thread: Active page.

  1. #1
    SitePoint Enthusiast
    Join Date
    Apr 2012
    Posts
    99
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    Active page.

    Hey there,

    So i am working with a site template. And the template has a class for the navigation to change the colour depending on the page (ie, change from blue to green).

    However i am using this as the site template so having the active class is no good. I know i can do this with PHP. But i don't know how i should apprroch it.


    Thanks in advance!! i can figure out the if i just need some guidence on how to get the current page.

  2. #2
    It's all Geek to me silver trophybronze trophy
    ralph.m's Avatar
    Join Date
    Mar 2009
    Location
    Melbourne, AU
    Posts
    23,590
    Mentioned
    411 Post(s)
    Tagged
    6 Thread(s)
    There are some good explanations of how to do it here:

    http://www.sitepoint.com/forums/show...87#post5091887

    Look at posts #8 and #10 in particular.

  3. #3
    SitePoint Member
    Join Date
    Sep 2012
    Posts
    1
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    try with some condition for getting css class!

  4. #4
    SitePoint Enthusiast
    Join Date
    Apr 2012
    Posts
    99
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Hey Ralph.m That's execatley what i was looking for! And i never though of building menus in php before with arrays! This has got me thinking <light bulb moment!>

  5. #5
    It's all Geek to me silver trophybronze trophy
    ralph.m's Avatar
    Join Date
    Mar 2009
    Location
    Melbourne, AU
    Posts
    23,590
    Mentioned
    411 Post(s)
    Tagged
    6 Thread(s)
    Quote Originally Posted by Cmarenburg View Post
    This has got me thinking <light bulb moment!>
    Yes, I found that post very enlightening, too, so I bookmarked it. Glad you find it useful.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •