jQuery and bootstrap references

cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Active Member

jQuery and bootstrap references

Hello everybody,

I'm doing customization by adding a carousel in the home page of the alfresco Share (Community verision 5.2) .

I managed to create an external module and added it to lib (as shown in this tutrial Add content to an Alfresco Share page | Alfresco Documentation ) after that I discovered that in order for the carousel to work it needs bootstrap and jQuery (see picture) . I serached further and discovered that we need to add resources in the extension's ressource markup located in the file resource.get.html.ftl file but then when I added this :

<@markup id="resources">
<#-- Use this "markup id" to add in a extension's resources -->

<@script type="text/javascript" src="${url.context}/res/js/jquery-3.3.1.js" group="template-common"/>
<@script type="text/javascript" src="${url.context}/res/js/bootstrap.js" group="template-common"/>

I get the "multipleDefine" error .

What do you suggest I do in order to make the Carousel work ( like this one Bootstrap Carousel ).

Regards..

1 Reply
Highlighted
Master

Re: jQuery and bootstrap references

Alfresco already ships and loads jQuery and some other libraries. You should try and avoid loading different versions of the same libraries already provided. There isn't really any clean way of "not loading" the version of jQuery that ships by default and replace that with your own - and you would have to risk any component of Alfresco using jQuery to stop working correctly with any other version.

Unless you find some way to isolate the different versions / have them coexist in the same page, or implement your functionality with the existing version, I don't see a way for you to succeed in integrating the Carousel...