Change content in page.tpl.php depending on the page
As you're already using a View to create your slideshow, could you not simply use an argument to change the View output based on URL? I would need to dig into the specifics of your site to help further, but that seems like the easiest thing to do - no custom functions necessary.