Sencha Architect 4.2 - How to painlessly change <title> in generated index.html

Viewed 43

I'm working on a project that has gone through a name change. I need to change the <title> property in the generated index.html. Normally, changing the name property on the application from Sencha Architect 4.2 has far-reaching effects. Simply changing the "name" of the app from within SA will affect namespaces, file and folder names, and even source control history...

Since the index.html is generated every time a build is performed, any manual changes made to this index.html get overwritten with the build.

The workaround I have so far is to hook into the application method and manipulate the DOM directly.

launch: function() { 
...
Ext.getDoc().dom.title= 'My Application Name';
...
}

Is there a way to feed additional configuration options for the index.html so that the build process properly uses the value we want? I would ideally like to remove this hack from my production code.

2 Answers

In Application you can set the title config option.

// @require @packageOverrides
Ext.Loader.setConfig({

});


Ext.application({
    models: [
        'Car'
    ],
    views: [
        'CascadingSelect'
    ],
    name: 'CascadingSelect',
    title: 'Some Title Here',

    requires: [
        'Ext.window.MessageBox'
    ],

    launch: function() {
        Ext.create('CascadingSelect.view.CascadingSelect');
    }

});

Would it be sufficient in your case to manually edit the file once and prevent SA from updating it?

Edit -> Project Settings -> General -> Untick 'Overwrite index file on save'

Related