Problem adding JQuery in ftl file

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

Problem adding JQuery in ftl file

Hi all,

I am trying to print a simple alert in login.get.html.ftl file using JQuery.So,I have added the following code

<@markup id="js">
   <#-- JavaScript Dependencies -->
   <@script src="${url.context}/res/components/guest/login.js" group="login"/>
    <script type="text/javascript">
      $(document).ready(function () {
        alert('This is login page');
        });
   </script>
</@>

But the alert is not working.plz guide me if I am missing anything.

Thanks and Best Regards

Ayushi Agrahari

2 Replies
krutik_jayswal
Senior Member II

Re: Problem adding JQuery in ftl file

It seems that you are trying to extend login page of alfresco.For overrind ftl in alfresco you need to do some other configurations as well.Below link will help you in same.Alfresco share is build on yui and aikau ,its better to use any of this instead of jquery.

Override Share sign in page | Alfresco Documentation 

jpotts
Professional

Re: Problem adding JQuery in ftl file

Did you confirm that your markup is actually showing up on the login page? I assume it is not if you are not seeing your alert.

Where did you make this change exactly and how did you package it up and deploy it?

In addition to what Krutik pointed you to you might also look at this add-on, which adds announcements to the login page: GitHub - jpotts/share-announcements: Alfresco add-on that allows system announcements to be managed ... 

That might give you an idea of how to extend the page with your own markup.