Modify If statement in template.php for Library resource