Dynamic browser title

4
Hi, Is there any way to change browser title in Mendix8.4.1? I want show dynamically only app title . Not  like “app title – page title” . I have tried as follows: 1.Change app title “mytitle” at Navigation.   →It shows “mytitle – “.  I don’t want that hyphen. 2.Write <title>mytitle</title> in each html file at theme folder   →It dosen’t work.It Shows default Mendix title or app title like No.1. 3.Write javascript   like this “document.title = “mytitle”;   →It sometimes changes but sometimes not changes. Is it because timing of loading JS ?   →Also When browser title changes it shows app title for an instance. Maybe during loading time.   Thank you in advance. Cheers,
asked
4 answers
2

It is not implemented by Mendix. Using your own javascript is your best bet. Once you have got it, share it in the Appstore as a widget.

*Editted: Does one of these appstoreApps work: https://appstore.home.mendix.com/link/app/308/ or https://appstore.home.mendix.com/link/app/2810

And everyone liking this idea, please upvote the 3-year old popular idea https://forum.mendix.com/link/ideas/76 of Jelle Dekker.

*More editting: Erika Shakya was able to solve this challenge by using CustomString Widget from the App Store: https://appstore.home.mendix.com/link/app/1426/

answered
1

We struggled with this as well but we ended up producing a widget to try to solve the problem.

Like you we went with your option 3 of using JavaScript to set the document.title. Timing is an issue so we added a configurable delay so we can wait a short while before changing the title.

However, adding the delay also caused problems if the page navigation was accessed too quickly as it could end up changing the title on the wrong page. To solve this we had to save the timer handle and if the page was navigated from we had to cancel the timer in the widget.

Another issue was visibility, so we had to check if the widget was actually in a visible block before running. Sometimes we needed it to be conditionally changed. This involved checking the context before setting the timer.

This approach feels really dirty and hacky, but it works for us. Ideally the page title should be easier to change in a Mendix app so it may be worth submitting a request on the Ideas Forum.

answered
2

This is part of Mendix 8.12

answered
0

may be  for your question this will be useful you can change the title of each page as  you wanted  in the title section of the page properties.

 

 

answered