The foam is intended to absorb direct, slow speed impacts and provide a small crush zone in direct higher speed impacts. Very little is needed to "hold it in place" as long as it is in the right position before an impact.
So, if it's no longer connected with the original fasteners, I just use... duct tape. It holds it in place well enough and nobody sees it anyways.
2001 Convertible - V6/Auto
1967 Coupe - 302/4spd