Research Gallery: "Back to homepage" leads to the DOXA site by default, in the gallery's language; a host's own home link still wins

This commit is contained in:
Doxa Maps 2026-10-02 02:13:47 +00:00
parent 56337e3861
commit b3de39a39e
2 changed files with 7 additions and 4 deletions

View file

@ -61,7 +61,7 @@ Add `?tab=<id>` to the `src` to open a specific map.
| `token-url` | none | Token endpoint forwarded to each map. |
| `tree-base` | derived from the script URL | Pin the tree root explicitly (needed only when the script is re-hosted apart from its tree). |
| `heading` | `DX-Maps` | Shell title (shown only when the shell header is enabled). |
| `home-href` | none | Your homepage. Shows a "Back to homepage" link directly above the rail’s Collapse button (at the top of the drawer on a phone). Without it there is no link. `javascript:` and `data:` URLs are ignored. |
| `home-href` | `https://doxa.life` (with `/ar`, `/fr`, … in the gallery's language) | Your homepage, for the "Back to homepage" link directly above the rail 19s Collapse button (at the top of the drawer on a phone). Pass your own to send readers back to your site. `javascript:` and `data:` URLs are ignored. |
| `home-label` | "Back to homepage" in the gallery’s language | The link’s text, in your own words. |
Tab ids: `dashboard-plus-grid` (Big Picture), `research-map-plus-grid` (Simple Research),

View file

@ -60,7 +60,7 @@
:dir="uiDir"
:lang="uiLocale"
:labels="layoutLabels"
:home-href="homeHref || cfg.homeHref || ''"
:home-href="homeHref || cfg.homeHref || defaultHomeHref"
:home-label="homeLabel || cfg.homeLabel || ''"
:title="headingText"
:nav-label="t('navLabel')"
@ -833,8 +833,8 @@ export default defineComponent({
// link into one map of the gallery. Falls back to ?tab= on the page URL, then the device default.
tab: { type: String, default: '' },
// The HOST's homepage: a "Back to homepage" link directly above the rail's Collapse button (a phone
// shows it at the top of the drawer). Also accepted as profile-config.homeHref / homeLabel. No URL,
// no link: the gallery never invents one, because it cannot know whose page it is on.
// shows it at the top of the drawer). Also accepted as profile-config.homeHref / homeLabel. With no URL
// from the host, the link goes to the DOXA site in the gallery's language (defaultHomeHref).
homeHref: { type: String, default: '' },
homeLabel: { type: String, default: '' }
},
@ -1062,6 +1062,9 @@ export default defineComponent({
},
// The locale the gallery's OWN words render in: the effective one when it ships, else English.
uiLocale() { return LOCALES.includes(this.effectiveLocale) ? this.effectiveLocale : 'en' },
// "Back to homepage" with no host to name one (a standalone page, the published tree): the DOXA site, in the
// gallery's language. A host's home-href, or profile-config.homeHref, always wins.
defaultHomeHref() { return 'https://doxa.life' + (this.uiLocale && this.uiLocale !== 'en' ? '/' + this.uiLocale : '') },
// Direction FOLLOWS THE GALLERY'S LANGUAGE, set explicitly on the layout root (a fallthrough attr
// on VerticalTabsLayout's .vtl): Arabic lays the shell out right-to-left (the layout mirrors its
// rail under :dir(rtl)), every other shipped locale left-to-right — including an English gallery