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

cancel
Showing results for 
Search instead for 
Did you mean: 
armin_solecki
Member II

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

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?

2 Replies
cjose
Senior Member II

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

Hmmm, not sure. Have you checked this blog on form stencils and I think I am using some external libs in those examples...Hope this helps

armin_solecki
Member II

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

Thanks for the link I will take a look.