Fix permalinks to show repr instead of pk in templates

refs #12999
Merge branch 'bug/12999' into develop