AnsweredAssumed Answered

How to add external JS/CSS from CDN/external domain

Question asked by armin.solecki on Jul 31, 2017
Latest reply on Aug 2, 2017 by armin.solecki

Hi,

 

I would like to add external assets (JS/CSS) that are served from CDN on external domain. This will be used to create custom stencils angular controller logic and some branded styling.

 

I have found that you can add resources thro app-cfg.js

 

/*
* Copyright 2005-2017 Alfresco Software, Ltd. All rights reserved.
* License rights for this program may be obtained from Alfresco Software, Ltd.
* pursuant to a written agreement and any use of this program without such an
* agreement is prohibited.
*/

'use strict';

var ACTIVITI = ACTIVITI || {};

ACTIVITI.CONFIG = {
    'onPremise' : true,
    'contextRoot' : '/activiti-app',
    'webContextRoot' : '/activiti-app',
    'locales': ['en','de','es','fr','it','nl','ja','nb','ru','zh-CN','pt-BR'],
    'signupUrl' : '#/signup'
};


ACTIVITI.CONFIG.resources = {
    '*': [
        {
            'tag': 'link',
            'rel': 'stylesheet',
            'href': 'http://example.com/custom-style.css?v=1.0'
        }
    ],
    'workflow': [
        {
            'tag': 'script',
            'type': 'text/javascript',
            'src': 'http://example.com/custom-app.js?v=1.0'
        }
    ]
};

 

But it does not seem to work.

Any ideas why?

Outcomes