I have an odd request to build a website where the look of the site will change depending on the ‘type’ of page we’re on, such as if it’s a video page, photo gallery, article, etc. I’ve been making views, such that I have a view called “article” and “video”, and I would like the header of my website to be different for each. Different colors, different components, different positions of elements… that sort of thing. So in order to do this, I will need to modify the way the main navigation is presented in the header.
My approach to this is to hard-code all this into the page.tpl.php code. No problem! And all I have to do is present certain sets of code depending on the view, which I can do with a simple PHP if statement. No problem! My problem, though, is how I can collect the information for which view is being used? How do I output the current view’s name? I’ve looked at other snippets of code online, but none have worked so far.