Moved breadcrumb check from template to functions