Select to view content in your preferred language

Experience Builder URL parameters and Document Title text browser tab for app with pages

422
1
Jump to solution
04-03-2024 01:36 PM
Labels (1)
Yuhash
by
Occasional Contributor

I have an Experience Builder Developer (v1.13) app with several pages. By default, the browser's document.title property for the published app's page is "<title of page> | <header title >"  and the app's page name appears in the URL as follows:  "https://<domain>/<app id>/?page=<page name>. 

My goal is to override the 'document.title' property so that I can set the URL parameters and the browser tab title independently of each other. In other words, I want to keep the URL as simple as possible, while setting a very detailed browser tab title. e.g. "This is my long browser title" which I do not want in my app page's URL: 'https://experience.arcgis.com/experience/appid/?page=simple' rather than 'https://experience.arcgis.com/experience/appid/?page=this%20is%the%20page%20name'

Screenshot 2024-04-03 123718.png

I know we can set the browser title for the app in the builder as shown in the screenshot above, but I want to be able to set different titles for different pages and would like to avoid creating a separate app for each page.

I have tried a couple of different methods to set the 'document.title' property and have successfully been able to implement it in a couple of custom widget .tsx files however the document title element gets overridden once the user interacts with the map and triggers pop-ups.

Has anyone been able to successfully customize this property? 

0 Kudos
1 Solution

Accepted Solutions
Yuhash
by
Occasional Contributor

We were able to override the 'document.title' property from reverting to the default 'page title| app title' by modifying the '\dist\cdn\0\jimu-core\index.js' file in the downloaded app.   As we have a separate custom widget that sets the 'document.title' property in an app page to a desired value, we set the variable "document.title" from 'r' to 'our desired value. 

 

 

View solution in original post

0 Kudos
1 Reply
Yuhash
by
Occasional Contributor

We were able to override the 'document.title' property from reverting to the default 'page title| app title' by modifying the '\dist\cdn\0\jimu-core\index.js' file in the downloaded app.   As we have a separate custom widget that sets the 'document.title' property in an app page to a desired value, we set the variable "document.title" from 'r' to 'our desired value. 

 

 

0 Kudos