Refactor page title handling into own method

It's not unlikely that a custom deployment would like to change the
title handling. Also adds a more sensible title when editing child
products without a title (instead of showing the parent's title).