diff --git a/famlist.php b/famlist.php index ee1b0d546f1..527c9214d22 100644 --- a/famlist.php +++ b/famlist.php @@ -83,6 +83,11 @@ $legend = I18N::translateContext('Unknown surname', '…'); } else { $legend = Filter::escapeHtml($surname); + // The surname parameter is a root/canonical form. + // Display it as the actual surname + foreach (QueryName::surnames($WT_TREE, $surname, $alpha, $show_marnm === 'yes', true) as $details) { + $legend = implode('/', array_keys($details)); + } } $url = WT_SCRIPT_NAME . '?surname=' . rawurlencode($surname) . '&ged=' . $WT_TREE->getNameUrl(); switch ($falpha) { diff --git a/indilist.php b/indilist.php index 448433334d4..4aea1fbee6a 100644 --- a/indilist.php +++ b/indilist.php @@ -20,8 +20,7 @@ * * @global Tree $WT_TREE */ -global -$WT_TREE; +global $WT_TREE; use Fisharebest\Webtrees\Controller\PageController; use Fisharebest\Webtrees\Functions\FunctionsPrintLists; @@ -84,6 +83,11 @@ $legend = I18N::translateContext('Unknown surname', '…'); } else { $legend = Filter::escapeHtml($surname); + // The surname parameter is a root/canonical form. + // Display it as the actual surname + foreach (QueryName::surnames($WT_TREE, $surname, $alpha, $show_marnm === 'yes', false) as $details) { + $legend = implode('/', array_keys($details)); + } } $url = WT_SCRIPT_NAME . '?surname=' . rawurlencode($surname) . '&ged=' . $WT_TREE->getNameUrl(); switch ($falpha) {