AnsweredAssumed Answered

how to include js scripts in freemarker templates

Question asked by hackerkok on May 29, 2017
Latest reply on May 30, 2017 by hackerkok

I want to include select2 in a .ftl file. Things I 've tried so far, but don't seem to work:

 

-add the below lines in the ftl file:

<@markup id="js">
   <@script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"/>
   <@script src="https://cdnjs.cloudflare.com/ajax/libs/select2/4.0.3/js/select2.min.js"/>
</@>

-add the below lines in the share-config.xml file in the share module amp:

<extension>
<modules>
   <module>
      <id>pdp</id>
      <version>1.0</version>
      <auto-deploy>true</auto-deploy>
      <configurations>
      <config>
         <forms>
            <dependencies>
            <js src="https://cdnjs.cloudflare.com/ajax/libs/select2/4.0.3/js/select2.min.js" />
            </dependencies>
         </forms>
      </config>
      <config evaluator="string-compare" condition="DocLibActions">
      <actions>
         .......

Outcomes