Liferay Terms Of Use Customization

Liferay-Terms-Of-Use


aim

Liferay Terms Of Use is highly configurable. When a user logs in for the first time, liferay terms of use is shown to the user. This terms of use can easily be customized according to our requirements. In this article we will focus on different approaches to customize liferay terms of use.


terms_of_use.jsp:

i) terms_of_use.jsp is responsible for displaying Liferay Terms Of Use page.

ii) In Liferay Tomcat Bundle (considering liferay tomcat bundle 6.2) the path of this page is 

/liferay-portal-6.2-ce-ga2/tomcat-7.0.42/webapps/ROOT/html/portal/terms_of_use.jsp

iii) In Liferay source code the path of the page is 

/liferay-portal-src-6.2-ce-ga2/portal-web/docroot/html/portal/terms_of_use.jsp

How to disable liferay terms of use:

By default liferay terms of use is enabled by the property terms.of.use.required=true in portal.properties file. However we can disable terms of use by adding below in portal-ext.properties

terms.of.use.required=false

Restart of tomcat server is needed to reflect this change. 

Customize terms_of_use.jsp by Hook:

We know that terms_of_use.jsp is the JSP which displays the content of liferay terms of use page. So we can customize this page by simple JSP Hook. At the end of the article download terms-of-use-hook and modify terms_of_use.jsp page according to your needs. After modifying deploy the hook. 

Liferay terms of use by web content:

In this approach we can create a web content and tell liferay to use this web content as terms of use content instead of default content. Below are the two properties that we need to add in portal-ext.properties file

terms.of.use.journal.article.group.id=
terms.of.use.journal.article.id=

In the above properties we should specify the groupId and article id of the web content. Follow the below steps to know article ID and groupId

Finding Article ID:

Go to the control panel and create a web content. I have created web content with name liferay-terms-of-use. After creating the web content publish it. Follow the below screen shot to find out article ID.

article-id

Finding Group ID:

Group ID is nothing but the Site ID in which our web content belongs. In the above we have created the web content. The web content should be associated with a particular site. So we need the group ID of that site. Refer the below screen shot.

site

To find out the final site ID navigate like

Control Panel -> Sites -> Liferay -> Configuration -> Site Settings

site-id

So according to my web content article id and group id the final properties  in portal-ext.properties will look like

terms.of.use.journal.article.group.id=10182
terms.of.use.journal.article.id=28721

Check Point:

Create a new user from the control panel and log into the portal by the new user credentials. You should see below liferay terms of use content.

liferay-terms-of-use-from-web-content

Download Source Code:

 terms-of-use-hook.zip

 

About The Author

2 thoughts on “Liferay Terms Of Use Customization”

  1. Hi Hamidul,

    How can we use this term of use page on pop-up, when a user first time login the portal that term of use page should come on pop-up!!

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Scroll to Top