before layout template