dynamic browser page title

1
Currently I am having an issue with a page where the Admins can choose which title the page should have.   So this page title is saved in an entity and thus I am able to retrieve it via MF, However it seems it is not possible to use a variable in the override page title to set the correct page title in the browser tab when calling the show page.   Is there any way to accomplish getting this user chosen title in the browser tab so it would look like β€˜AppName – Dynamic PageTitle’    
asked
3 answers
1

This is an idea which apparently was already added to the backlog by Mendix.. I'd suggest to vote for it, so hopefully it will be included in the modeler soon: https://forum.mendix.com/link/ideas/76

 

Until then, I see there is a widget in the App Store that you can try (although the most recent comment leads to believe it no longer works in Mendix7. Perhaps you can contact the developer to update it)

https://appstore.home.mendix.com/link/app/2810/ – Dynamic HTML Title

answered
1

Sorry, that widget does not work any more. This is indeed possible, we ended up implementing the following:

 

    ...
    _updateRendering: function (callback) {
     if (this._contextObj !== null) {
      if(this._contextObj.get(this.attr_title)!=null){
       document.title=this._contextObj.get(this.attr_title);
      }else{
       document.title=this.str_title_original;
      }
     } else {
      document.title=this.str_title_original;
     }
     this._executeCallback(callback, "_updateRendering");
    },
    ...

You’ll have to roll your own, and change the stuff in updateRendering. You can also come up with something cool that reflects every single page from deployment into a domain, and have a configuration for retitle everything, in that case you have to do some more complex stuff, but its also possible

answered
1

Hi Tom,

I may be a little late but I built a widget that does this functionality in mx7. Here is the link to my github. 

https://github.com/austinmcnicholas/Dynamic-Browser-Title/releases/tag/1.1.0

 

Hope this helps!

answered