Split main page into a PHP template