Setup a renderWithLayout function