cancel
Showing results for 
Search instead for 
Did you mean: 

how to add js library to ftl template

zhasik92
Champ on-the-rise
Champ on-the-rise

Hi, Community!

How to add JS library to ftl controller?

I've tried to add library  to mypopup.ftl:

<script type="text/javascript" src="${url.context}/res/js/yui-min.js"/>
or
<@script src="http://yui.yahooapis.com/3.18.1/build/yui/yui-min.js"></@>
but it is not working.


<
script type="text/javascript">
YUI().use("panel", function (Y) {  // loading escape only for security on this page
    ...
    });

});
<script/>

But everytime I get error YUI is undefined.

3 REPLIES 3

angelborroy
Community Manager Community Manager
Community Manager

FTL pages are including YUI by default. Maybe you can start by reading this: Adding a new Surf page to Alfresco Share | Alfresco Documentation 

Hyland Developer Evangelist

Thanks.  Which version of YUI  Alfresco 5.1 uses? 

angelborroy
Community Manager Community Manager
Community Manager

2.9.0

Hyland Developer Evangelist