I would like to vary what part of my theme is displayed based on what the user is looking at. For example, if the user is at the main gallery page I would like a little welcome message but once they enter a specific album that message should go away.
I tried modifying my theme.php file to check if the album variable was set but that didn't seem to work. Any suggestions?
You can use anycontent.php for this.
The part I'm looking to vary is a side bar which has a menu for non-cpg stuff. I don't think I can do with the anycontent.php. Is there a way to do this by hacking some of the cpg files?
If it's an html menu that can go in your theme's template.html, otherwise treat it as a custom header/footer.
I know I can just put the code for the menu in the template.html file, but how do I control whether or not it should be displayed?
You'll have to modify theme.php to add your side menu, and use an if-then block to determine if it should be displayed. If you search the forums you will find good posts on how to modify a theme.