07-25-2017 06:19 AM
Hi there,
I'm trying to figure out how to override/replace client-side Javascript using SDK 3.
For example on the document-details.ftl page it uses:
<@script type="text/javascript" src="${url.context}/res/modules/documentlibrary/doclib-actions.js" group="document-details"/>
If I wanted to replace doclib-actions.js with my own script, where do I place it in the SDK 3.0 project and what would I replace
src="${url.context}/res/modules/documentlibrary/doclib-actions.js"
with?
Thanks
Paul
07-26-2017 06:16 AM
Ok, found the solution...
Place your custom client-side JS in the SDK project in the folder:
META-INF/resources/<your_module_name>/<whatever path you like>
(there is already an example in META-INF/resources/<module_name>/js/tutorials)
Then, in the FTL that you need to include your script the path will be something like:
<@script type="text/javascript" src="${url.context}/res/<your_module_name>/<whatever path you like>/my-doclib-actions.js" group="document-details"/>
07-26-2017 06:16 AM
Ok, found the solution...
Place your custom client-side JS in the SDK project in the folder:
META-INF/resources/<your_module_name>/<whatever path you like>
(there is already an example in META-INF/resources/<module_name>/js/tutorials)
Then, in the FTL that you need to include your script the path will be something like:
<@script type="text/javascript" src="${url.context}/res/<your_module_name>/<whatever path you like>/my-doclib-actions.js" group="document-details"/>
08-04-2017 11:22 AM
have you found out how to actually override existing JS files? your solution is to make custom files and use them, but how can I override existing alfresco files (e.g. in {share.war}/components/...)?
Explore our Alfresco products with the links below. Use labels to filter content by product module.