Barons Posted November 25, 2010 Share Posted November 25, 2010 Hi, Sorry if this is in the wrong place. I really just need a search term to use for what i'm trying to do. I would like my buttons to appear pressed on each page. For example if you are on the home page the home button will appear pressed. If you are on the screenshots page the screenshots button will appear pressed. Pretty much i want my nav bar to display what page is being viewed. I'm using SMF forums and i've created an extension of my forum that i'm using on the root of my site. As far as i can tell i have the correct code added to the forum that should highlight the home button while on the home page. The part i'm missing is the code to add onto the home page. This is the code I have on the button. $buttons = array( 'overview' => array( 'title' => $txt['overview'], 'href' => 'http://www.wararmada.com', 'show' => true, 'sub_buttons' => array( 'alliance' => array( 'title' => $txt['alliance'], 'href' => $scripturl . '?action=overview;area=alliance', 'show' => true, ), This is the code i have in the language file. $txt['overview'] = 'overview'; I'm not sure what this is called. I don't know anything about php but so far i've been able to get by just using google but I don't really know how to search for this. Thanks for all the help! Quote Link to comment Share on other sites More sharing options...
Barons Posted November 25, 2010 Author Share Posted November 25, 2010 bumb Any ideas? Quote Link to comment Share on other sites More sharing options...
Anti-Moronic Posted November 25, 2010 Share Posted November 25, 2010 I've not extended SMF at all, but I can tell you the common way to approach this is by dynamically setting the 'class' of the nav items. If you are on the corresponding page for any given item, a class is assigned to the element, which you then style in your css. It is usually ".selected". However, there may be a way SMF does this for you with a simple flag - I'm not sure. I would first go here: http://www.google.co.uk/search?q=php+nav+highlight+selected+&ie=utf-8&oe=utf-8&aq=t&rls=org.mozilla:en-GB:official&client=firefox-a You might also try searching for SMF plugins which can do this for you automatically. Quote Link to comment Share on other sites More sharing options...
Barons Posted November 25, 2010 Author Share Posted November 25, 2010 Thanks for the help! Now i should be able to research enough to find out how to do it. Cheers! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.