Could you please share an idea how to change page title for lightning app?
1 Answer
Today you can add this:
document.title = "Your Title";
in your .app's init handler:
<aura:handler value="{!this}" name="init" action="{!c.init}"/>
in your app's controller:
init: function(component, event, helper) {
document.title = "Your Title";
}
This happens a bit later than you would like so you will see Aura in the title for a short interval and then it gets replaced with Your Title.
There is a new feature being exposed in Lightning Components soon that lets you customize the app's "template" markup that will make this both trivial and eliminate the Aura -> Your Title "flash". template= for apps exists already in Aura open source so you can read about it at least - we were waiting on a few changes to the way templates work before exposing them via Lightning where we have to support them in a push update world. See https://github.com/forcedotcom/aura/raw/master/aura_oss.pdf Creating App Templates to get a preview of what is coming to LC.
-
the feature to change title using template is documented but didn't work in my org developer.salesforce.com/docs/atlas.en-us.lightning.meta/… I had "No COMPONENT named markup://MyAppTemplate found" error Jun 28, 2017 at 8:59
-
1Hi @Doug, do you have any more up to date information on this? I can't use this solution in a managed package, and I think the template is only for aura apps and not components. salesforce.stackexchange.com/questions/221954/…– JamesJun 19, 2018 at 22:22