This website uses cookies to ensure you get the best experience on our website.

Skip to content
LOGO
  • Company

    About IGNEK

    Learn about our story and our mission.

    Careers

    We're hiring!

    We always looking for talented peoples. Join our team!

    Blogs

    The latest industry news, updates and info.

    Case Studies

    Take a closer look at the projects we've delivered

    Webinar

    Watch our latest organized webinar

    Get in touch with our HR team

    • hr@ignek.com
    • +91 93284 95160
    • Ahmedabad, Gujarat, India – 382470
  • Services

    Enterprise Portal Development

    Custom Enterprise Portal Development for flawless Solutions

    Dedicated Development Team

    Expand Teams, Optimize Development with Our Expertise

    Back-end Development

    Empowering your digital presence with robust backend development expertise

    Front-end Development

    Crafting engaging user experiences through expert frontend development

    Digital Transformation

    Embrace digital transformation by modernizing process

    SaaS Development

    Transform your business with SaaS Innovative Solutions

    Technologies

    Liferay Services

    Development & Customization

    Theme

    Upgradation

    Migration

    Proof of Concept

    Performance Tunning

    Architecture

    Support & Maintenance

    E-commerce

    Expert Advice

    React Services

    Enterprise Development

    Custom Application

    Single Page Application

    Architecture

    API Integration

    Migration

    Consulting

    Maintenance & Support

    Spring Boot Services

    Web Service

    MVC Web Development

    API Integration

    Security

    Migration

    Microservices

    Support & Maintenance

    AEM Services

    Consulting Service

    Site Development

    Migration & Upgradation

    Integration

    Maintenance & Support

    Custom Solutions

    Content Management

    Team Augementation

  • Solution

    Ready for digital excellence

    In our rapidly evolving world, businesses are always on the lookout for fresh ways to improve their operations and connect with their audiences.

    Contact US

    Solutions

    SaaS : Software As A Service

    Transforming industries through cutting edge SaaS solutions.

    Customer Portal : Boost Business Productivity

    Streamline operations and enhance productivity with our Customer Portal solution.

    Liferay Based Intranet Portal

    Internal portal for company communication, collaboration and resources

    Integration

    Matomo Integration with Liferay

    Integrate Matomo to enable user interactions seamlessly.

    Microsoft Teams integration with Liferay

    Integrate to enable seamless collaboration, messaging within your portal.

    Jira Integration With Liferay

    Optimizes business operations by integrating with Jira.

  • Hire Us

    Liferay

    Get expert Liferay developers for seamless portal solutions.

    React JS

    Get expert ReactJS developers for dynamic web solutions.

    Web Developer

    Get custom web solutions from IGNEK's expert developers.

    Spring Boot

    Get top-notch Spring Boot developers for your project success!

    Healthcare

    Get top Healthcare Developers for cutting-edge medical software.

    MERN Stack

    Get expert MERN developers from IGNEK for custom, innovative project solutions.

    Why Hire Developers From IGNEK ?

    • Certified Developer
    • Transparent Communication
    • Flexible Hiring Modals
    • Fully Signed NDA
    • Cost Effective
    • Easy Exit Policy

    Get in touch with our Sales team

    • sales@ignek.com
    • +91 6351576580
    • info@ignek.com
    • Ahmedabad, Gujarat, India – 382470
SCHEDULE CALL
  • COMPANY
    • About
    • Case Studies
    • Blogs
    • Career
    • Webinar
  • SERVICES
    • Enterprise Portal Development
    • Dedicated Development Team
    • Back-end Development
    • Front-end Development
    • Digital Transformation
    • SaaS Development
  • SOLUTION
    • Customer Portal:  Boost Business Productivity
    • SaaS : Software as a Service
    • Liferay Based Employee Intranet Portal
  • TECHNOLOGY
    • Liferay Services
      • Liferay Development and Customization
      • Liferay Theme Development Service
      • Liferay DXP 7.4 Upgrade
      • Liferay Migration
      • Liferay Proof Of Concept
      • Liferay Performance Tuning
      • Liferay Architecture Design Service
      • Liferay Support And Maintenance Service
      • Liferay Ecommerce Development
      • Liferay Expert Advice
    • ReactJS Services
      • ReactJS Enterprise Application Development
      • ReactJS Custom Application Development
      • ReactJS Single Page Application Development (SPA)
      • ReactJS Applications Architecture
      • ReactJS API Integration
      • ReactJS Migration
      • ReactJS Consulting
      • ReactJS Maintenance and Support
    • Spring Boot Services
      • Spring Boot Web Development Service
      • Spring MVC Web Development
      • Spring Boot API Integration Service
      • Spring Boot Security
      • Spring Boot Migration Service
      • Spring Boot Microservices
      • Spring Boot Support & Maintenance Service
    • AEM Development Services
      • AEM Consulting Services
      • AEM Site Development
      • AEM Migration & Upgradation
      • AEM Integration Services
      • AEM Maintenance & Support
      • AEM Content Management
      • Custom AEM Solutions
      • AEM Team Augmentation
  • INTEGRATION
  • HIRE US
    • Hire Liferay Developer
    • Hire ReactJS Developer
    • Hire Spring Boot Developer
    • Hire Healthcare Developer
    • Hire Web Developer
    • Hire MERN Stack Developer
  • CONTACT US
  • Company

    About IGNEK

    Careers

    We're hiring!

    Blogs

    Case Studies

    Webinar

    Get in touch with our HR team

    • hr@ignek.com
    • +91 93284 95160
    • Ahmedabad, Gujarat, India – 382470
  • Services

    Enterprise Portal Development

    Dedicated Development Team

    Back-end Development

    Front-end Development

    Digital Transformation

    SaaS Development

    Technologies

    Liferay Liferay Services
    • Development & Customization
    • Theme
    • Upgradation
    • Migration
    • Proof of Concept
    • Performance Tuning
    • Architecture
    • Support & Maintenance
    • E-commerce
    • Expert Advice
    React React Services
    • Enterprise Development
    • Custom Application
    • Single Page Application
    • Architecture
    • API Integration
    • Migration
    • Consulting
    • Maintenance & Support
    Spring Boot Spring Boot Services
    • Web Service
    • MVC Web Development
    • API Integration
    • Security
    • Migration
    • Microservices
    • Support & Maintenance
    AEM AEM Services
    • Consulting Service
    • Site Development
    • Migration & Upgradation
    • Integration
    • Maintenance & Support
    • Custom Solutions
    • Content Management
    • Team Augmentation
  • Solution

    Ready for digital excellence

    In our rapidly evolving world, businesses are always on the lookout for fresh ways to improve their operations and connect with their audiences.

    Contact US

    Solutions

    SaaS : Software As A Service

    Customer Portal : Boost Business Productivity

    Liferay Based Intranet Portal

    Integration

    Matomo Integration with Liferay

    Microsoft Teams integration with Liferay

    Jira Integration With Liferay

  • Hire Us

    Liferay

    React JS

    Web Developer

    Spring Boot

    Healthcare

    MERN Stack

    Why Hire Developers From IGNEK ?

    • Certified Developer
    • Transparent Communication
    • Flexible Hiring Modals
    • Fully Signed NDA
    • Cost Effective
    • Easy Exit Policy

    Get in touch with our Sales team

    • sales@ignek.com
    • +91 6351576580
    • IGNEK
    • Ahmedabad, Gujarat, India – 382470
  • SCHEDULE CALL

Customize and handle Liferay login using a fragment

  • Liferay
  • September 30, 2025

Share On :

Introduction

In Liferay, the default login portlet serves the basic authentication flow but often falls short when projects demand a custom look & feel. Fragments provide a lightweight and flexible way to override or enhance the login experience without touching the core portal code. By creating a login fragment, developers can redesign the form, inject custom validations using scripts, or extend the login process while still leveraging Liferay’s built-in authentication framework. This approach keeps customization upgrade-safe and fully aligned with Liferay best practices.

Prerequisites :
  • Liferay DXP/Portal 7.X

  • Basic knowledge of Liferay

Environmental Requirements :
  • Liferay Portal or DXP

Ways to customize Liferay’s login using fragments :

01) Create a new site or use guest site

  • The first step in customizing Liferay’s login functionality out of the box is to build a new Liferay site if you want site-level login capabilities, or to use Liferay’s existing guest site.

  • Here we will create a new site.

  • Go to Control Panel > Sites > Create a new site. Give the site a name that suits your needs.

02) Add public page for sign-in

  • In the next stage, we’ll develop Liferay’s public page and place it at the top of the page list.

  • I created a page in my test site and gave it the name sign-in.

site_indication
  • As you can see in the image above, we need to create a blank page in our newly created site.
  • Go to the page’s setup and hide it from navigation, as well as close the header and footer sections.
page_configuration

03) Create a fragment for sign-in implementation & design

  • Now we must develop a Liferay fragment to design the sign-in page and map the login functionality.

Fragment
  • As you can see in the image above, I have created a Sign in fragment under the blog folder.
  • Now we design and customize the default Liferay’s login functionalities.
  • HTML
				
					[#if themeDisplay.isSignedIn() && !themeDisplay.getLayout().isSystem()] <script type="litespeed/javascript">window.location.replace('${themeDisplay.getPathFriendlyURLPrivateGroup() + themeDisplay.getScopeGroup().getFriendlyURL()}')</script> [@liferay_aui.script]
window.location.replace("${themeDisplay.getPathFriendlyURLPrivateGroup() +
themeDisplay.getScopeGroup().getFriendlyURL()}"); [/@] [/#if]

<div class="bg-brand-primary-darken-5 custom-sign-in vh-100">
	<div class="h-100 no-gutters row">
		<div class="col-lg-4 col-md-5 d-flex form-column text-neutral-0">
			<div class="align-items-center d-flex flex-column justify-content-center mr-6 custom-login-form">
				<a data-lfr-editable-id="home" data-lfr-editable-type="link" href="#">
					<img data-lazyloaded="1" src="data:image/gif;base64,R0lGODdhAQABAPAAAMPDwwAAACwAAAAAAQABAAACAkQBADs=" decoding="async" class="ml-3 mt-6 position-absolute sign-in-logo" data-lfr-editable-id="custom-logo" data-lfr-editable-type="image" data-src="[resources:logo_inv.svg]" alt="[resources:logo inv | Customize and handle Liferay login using a fragment" title="[resources:logo inv | Customize and handle Liferay login using a fragment">
				</a>

				<div class="ml-lg-10 ml-md-10 ml-sm-0 w-100">
					<h3 class="login-title">Sign in to Page</h3>
					[@liferay_portlet.runtime					portletName="com_liferay_login_web_portlet_LoginPortlet" /]
				</div>
			</div>
		</div>

		<div class="col-lg-8 col-md-7 sign-in-image"></div>
	</div>
</div>

				
			
  • Javascript
				
					const EMAIL_INPUT_ID = '#_com_liferay_login_web_portlet_LoginPortlet_login';
const PASSWORD_INPUT_ID =
	'#_com_liferay_login_web_portlet_LoginPortlet_password';

function inputValidation() {
	const emailInput = fragmentElement.querySelector(EMAIL_INPUT_ID);
	const passwordInput = fragmentElement.querySelector(PASSWORD_INPUT_ID);

	if (emailInput) {
		window.onload = function () {
			emailInput.focus();
		};
	}

	emailInput.focus();

	const EMAIL_REGEX = /^[\w-.]+@([\w-]+\.)+[\w-]{2,4}$/g;

	const TEXT_VARIANT = {
		danger: 'border-danger',
		success: 'border-success',
	};

	const isEmailValid = (email) => {
		const regex = new RegExp(EMAIL_REGEX);

		return regex.test(email);
	};

	function onInputChange(element, validation) {
		if (validation) {
			element.classList.remove(TEXT_VARIANT.danger);
			element.classList.add(TEXT_VARIANT.success);

			return;
		}

		element.classList.remove(TEXT_VARIANT.success);
		element.classList.add(TEXT_VARIANT.danger);
	}

	emailInput.addEventListener('change', () =>
		onInputChange(emailInput, isEmailValid(emailInput.value))
	);

	passwordInput.addEventListener('change', () =>
		onInputChange(passwordInput, passwordInput.value !== '')
	);
}

inputValidation();

				
			
  • As you can see in the code above, I have designed a login fragment as per my requirement.

  • You can design with CSS and JS as per your requirement.

  • I’ve added functionality that allows users to see the login element while they’re signed in, but not when they’re not.

  • You can also add new HTML tags and CSS to add extra functionality.

04) Put fragment on the page

  • Now, open the page editor for the sign in page and place the sign in fragment on it.

sign-page-editing
  • on the page.

  • Publish the sign in page and hit the page URL in the incognito window.

For me the URL is “http://localhost:8080/web/test-1/sign-in”

image
  • As shown in the image above, this is my custom login page design, which allows you to simply log in to the Liferay portal.

Conclusion

Customizing the login experience in Liferay with fragments gives you the perfect balance between flexibility and maintainability. Instead of overriding core components, you can tailor the design, add validations, and enhance usability—all while keeping the solution upgrade-safe. Whether it’s aligning the login page with your branding or introducing custom logic, fragments make the process simple and effective. With this approach, you not only improve the user experience but also maintain clean, modular, and future-ready portal development.

Explore Our Services

Discover how we can help your business thrive, whether you’re running a small startup, an SME, or a large enterprise. We’re here to understand your unique needs and goals, offering the expertise and resources to support your journey to success.
Stay informed about our Liferay services and updates by subscribing to our newsletter—just fill in the details below to subscribe.

Loading
Loading...

Related Blogs

November 28, 2024
Google Login Integration In Liferay
Google Login Integration In Liferay
August 5, 2024
Liferay Object with Form Fragment
Liferay Object with Form Fragment
April 17, 2023
Fragments in Liferay Cover Image
Fragments in Liferay
Loading...

Featured Projects Portfolios

June 19, 2024
Music License Management Portal _ Onboarding & Data Integrity
Music License Management Portal : Onboarding & Data Integrity
November 25, 2024
Liferay DXP Based Intranet Portal Migration from 7.0 to 7.4
Liferay DXP Based Intranet Portal Migration from 7.0 to 7.4
November 29, 2024
Employee Intranet Portal for Government Entity
Employee Intranet Portal for Government Entity

Digital Solutions for Your Business with IGNEK

4.9

5.0

5.0

5.0

LOGO

Making the world a better place through constructing elegant hierarchies

COMPANY

  • About
  • Career
  • Case Study
  • Blogs

SERVICES

  • Enterprise Portal Development
  • Dedicated Development Team
  • Back-end Development
  • Front-end Development
  • Digital Transformation
  • SaaS Development

HIRE US

  • Liferay
  • Spring Boot
  • ReactJS
  • Healthcare
  • MERN Stack
  • AEM

CONTACT

  • info@ignek.com
  • info@ignek.com
SALES
  • sales@ignek.com
  • (+91) 635 157 6580
CAREER
  • hr@ignek.com
  • (+91) 932 849 5160
  • E 910-912, Ganesh Glory 11, Jagatpur Road, SG Highway, Ahmedabad, Gujarat - 382470

© 2018-2025 IGNEK, Inc. All rights reserved

Linkedin Facebook X-twitter Instagram