Themes and Layout Templates backport for 6.1.x