Fix issues managing pages/page types that have no assigned fields

See issue #2227 for a description of this problem. Adding some IF
statements to these files seems to have fixed it.
Fixes error when using format:url_title tag

Fix for issue #2228