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
Solved! Go to Solution.
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"/>
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"/>
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/...)?
Ask for and offer help to other Alfresco Content Services Users and members of the Alfresco team.
Related links:
By using this site, you are agreeing to allow us to collect and use cookies as outlined in Alfresco’s Cookie Statement and Terms of Use (and you have a legitimate interest in Alfresco and our products, authorizing us to contact you in such methods). If you are not ok with these terms, please do not use this website.