Home

Customize login page is very basic requirement when we thought of customizing alfresco share User Interface. First thing which comes to mind is login page. So, here are the steps which you could follow to achieve that.

Modify share-config-custom.xml file, in alfresco/web-extension directory.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
<alfresco-config>
   <config evaluator="string-compare" condition="WebFramework">
      <web-framework>
         <defaults>
            <page-type>
               <id>login</id>
               <page-instance-id>custom-login</page-instance-id>
            </page-type>
         </defaults>
      </web-framework>
   </config>
</alfresco-config>

Then, we should create a custom-login.xml file like this in the alfresco/site-data/pages dir.

1
2
3
4
5
6
7
<page>
   <template-instance>custom-login</template-instance>
   <authentication>none</authentication>
</page>

Now, create another file also called custom-login.xml file, and move it to alfresco/site-data/template/instances.

1
2
3
4
5
<template-instance>
   <template-type>demo/custom-login</template-type>
</template-instance>

In the end, create the freemarker template (custom-login.ftl) of our new login page, and move it to alfresco/templates/demo.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
<html>
   <head>
      <title>Custom Application Login</title>
   </head>
   <body>
      <form id="loginform" accept-charset="UTF-8" method="post" action="${url.context}/page/dologin">
         Username: <input type="text" id="username" name="username"/><br>
         Password: <input type="password" id="password" name="password"/><br>
         <input type="submit" id="btn-login" />
      </form>
   </body>
</html>

Restart Alfresco, and go to http://localhost:8080/share URL. You’ll be prompted with the new login page. In this way we can also import any CSS file we want in our custom Share login page and style it as well. In the upcoming video, we’ll talk about extending Share using JAR packages.

Looking for quality Alfresco Hosting? Look no further than Arvixe Web Hosting!

Publicités

Laisser un commentaire

Choisissez une méthode de connexion pour poster votre commentaire:

Logo WordPress.com

Vous commentez à l'aide de votre compte WordPress.com. Déconnexion / Changer )

Image Twitter

Vous commentez à l'aide de votre compte Twitter. Déconnexion / Changer )

Photo Facebook

Vous commentez à l'aide de votre compte Facebook. Déconnexion / Changer )

Photo Google+

Vous commentez à l'aide de votre compte Google+. Déconnexion / Changer )

Connexion à %s