run script if page ==

Permalink
Hi looking for a bit of help trying to run a simple script / bit of jquery if the page is == home using this code
<?php   $page = Page::getCurrentPage();
   $pageid = $page->getCollectionID();
   if ($pageid == home) {echo '<script> $(document).ready(function(){   
   $('#logo').fadeIn(4000);
});</script>'; }
 ?>


I'm not quite sure of my syntax and keep getting errors.

Any help appreciated.

thanks

 
JohntheFish replied on at Permalink Reply
JohntheFish
pageid is a number (0 or 1 for home, I forget which).
home is a page handle.

The php syntax error is because 'home' needs to be quoted, But you should either put a number there, or get the page handle.