Hi Team,
We want to add some custom JS on aem author instance on each and every page.
Can anyone please help me to suggest where I put this JS so that call on each page.
Thanks
Bhagchand
Solved! Go to Solution.
Views
Replies
Total Likes
Add the js in author clientlibrary .
Ref : https://sourcedcode.com/blog/aem/adding-custom-client-library-for-aem-author-editor-touch-ui
Add the js in author clientlibrary .
Ref : https://sourcedcode.com/blog/aem/adding-custom-client-library-for-aem-author-editor-touch-ui
Thanks a lot, let me check
Hi @bhagchand,
In addition to Himanshu's comment earlier, if you have a common clientlibs and need to be loaded only in author mode, you can add it in the page component and restrict it only to author mode.
<sly data-sly-test="${wcmmode.preview || wcmmode.edit}" data-sly-call="${clientLib.all @ categories='category.name'}"/>
I hope it helps.
Regards,
Rohit
Thanks let me check
@bhagchand , is this js required for any dialog validation or dialog function or any direct functionality on the page?
I am asking this because you mentioned AUTHOR instance.
Hi @Umesh_Thakur ,
Basically we want admin user logged out after 15 mins inactivity.
we also changed apache token expiration configuration from admin but it will forcefully logged out user after 15 mins.
So from the JS we can manage like this.
what all will be included in user activity ? will it be limited to content authoring or it will be extended to any activity by the author like changing system configuration, making any change in workflow model etc?
Normally mouse click or key pressing are being taken as activity? so can you confirm that as well
based on this answer we can decide the approach thru JS or thru any server side implementation.
Yes @Umesh_Thakur ,
we want to track user on mouse-hover, key press.
So I found one header.jsp in /apps/granite/ui/components/shell/collectionpage/header.jsp
We put custom js in this file and working fine on the pages which have the common header.
But this is not working in the distribution pages and osgi configuration console.
Can you please help to suggest any better approach for the same.
Thanks
got it...
see the below old community questions for exactly same requirement.
Hope this helps
Umesh Thakur
Yes, Tried already but this forcefully logged out user after certain period.
It not consider user inactivity.
oookay...!
In this case we need to think of a solution which fits into this requirement.
Anyway the proposed solution by you may work in page editing case not certainly will not work when user will access the other consoles of AEM like confManager etc.
So can you think of anything like chrome browser plugin creation with the same js, you have written for your solution. this plugin will track user's inactivity and then clear the session cookie from the browser.
this way you can handle the stuff easily and effectively.
Hope this helps
Umesh Thakur