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.
<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.
<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.
<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.
<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!
I have a problem, how i show the error login message?? Thanx
Hi Frank,
You can have one more field on the same custom ftl file which will be blank initially once you have failed login attempt you can set that message value.
You actually make it seem so easy with your presentation but I find this topic to be really something which I think I would never understand. It seems too complicated and extremely broad for me. I am looking forward for your next post, I’ll try to get the hang of it!