[FORWARD PORT] LPS-24062 show back link when appropriate

This is a forward port of https://github.com/sergiogonzalez/liferay-plugins-ee/pull/119