/o//commerce-media/accounts/-1/images/18390613?download=true

Custom Landing Page Hook
Icon
DXP App
18389762
After a user logs into Liferay, it is a common requirement to be able to redirect them to a different page based on their Organization or Site membership. This hook allows you to specify the desired redirection behavior using a properties file setting. Based on the properties file, it will redirect the user to their private page, public page, their default site's public/private homepage, or their default organization's public/private homepage. Simply install the hook and specify the property by overriding the following settings in your hook's portal.properties:

##
## Set override.default.landing.page.path to true if you want this property be override
## by CustomLandingPage path. If this is not provided by default it will take its value
## as true. And if this is set to false, CustomLandingPage hook will redirect to this page
## only. It needs to be true in case of Custom Landing page to work.
##
override.default.landing.page.path=true

##
## Set this property as per your needs for landing page after user log in. It could be from one of
## the value from below options
## 1. userPrivatePage
## 2. userPublicPage
## 3. sitePublicPage
## 4. sitePrivatePage
## 5. organizationPublicPage
## 6. organizationPrivatePage
## 7. role
## 8. userGroup
##
## For sitePublicPage, sitePrivatePage, organizationPublicPage, organizationPrivatePage option we
## can provide specific landing page friendly URL in custom attribute.
## example,
## For site/organization PublicPage, we can provide landing page in site custom attribute with key "landingPagePublic"
## landingPagePublic = /myHome , where /myHome is frienlyURL of a public page exist in particular site/organization site
## For site/organization PrivatePage, we can provide landing page in site custom attribute with key "landingPrivatePublic"
## landingPagePublic = /myPrivateHome , where /myPrivateHome is frienlyURL of a private page exist in particular site/organization site
## For role & userGroup, we can provide landing page complete relative URL in role OR userGroup's custom attribute with key "landingPage"
## landingPage = /web/mysite/home
##
## For more details,
## https://github.com/opensourceforlife/CustomLandingPage-Hook
##
custom.landing.page.type={userPrivatePage/userPublicPage/sitePublicPage/sitePrivatePage/organizationPublicPage/organizationPrivatePage/role/userGroup}

For defining,
1) Site/Organization's Public page
- Create custom attribute of type "TextField" with key "landingPagePublic" and define value as desired page's friendlyURL. i.e. /welcome
2) Site/Organization's Private page
- Create custom attribute of type "TextField" with key "landingPagePrivate" and define value as desired page's friendlyURL. i.e. /myhome
3) Role/UserGroup
- Create custom attribute of type "TextField" with key "landingPage" and define value as desired page's complete page URL. i.e. /web/mysite/myhome

- Glassfish with PACL issue
There is an open PACL/Glassfish issue which is currently under investigation (https://issues.liferay.com/browse/LPS-39137) .
Until it will get fixed below is the workaround for glassfish users.
1. Start Glassfish with security manager
2. Make sure portal.security.manager.strategy is set to "liferay" in poral-ext.properties

For complete release history visit -
https://github.com/opensourceforlife/CustomLandingPage-Hook /releases

For any issue/query/help/feedback,
Reach out to me @ admin{at}opensourceforlife.com
DEVELOPER
处理模板时发生错误。
For "." left-hand operand: Expected a hash, but this has evaluated to a string (wrapper: f.t.SimpleScalar):
==> specifications  [in template "3192443#3192485#null" at line 16, column 36]

----
FTL stack trace ("~" means nesting-related):
	- Failed at: #if specifications?has_content && spe...  [in template "3192443#3192485#null" at line 16, column 1]
----
1<#assign 
2	channels = restClient.get("/headless-commerce-delivery-catalog/v1.0/channels") 
3	channelId = "" 
4/> 
5 
6<#list channels.items as channel> 
7	<#if channel.name == "Marketplace Channel"> 
8		<#assign channelId = channel.id /> 
9	</#if> 
10</#list> 
11 
12<#if (CPDefinition_cProductId.getData())??> 
13	<#assign specifications = restClient.get("/headless-commerce-delivery-catalog/v1.0/channels/" + channelId + "/products/" + CPDefinition_cProductId.getData() + "/product-specifications") /> 
14</#if> 
15 
16<#if specifications?has_content && specifications.items?has_content> 
17	<#list specifications.items as specification> 
18		<#if specification.specificationKey?has_content && specification.specificationKey == "developer-name"> 
19			${specification.value} 
20		</#if> 
21	</#list> 
22</#if> 
DEVELOPER
14-3-10 上午12:00
Published date
处理模板时发生错误。
The string doesn't match the expected date/time/date-time format. The string to parse was: "14-3-10 上午12:00". The expected format was: "MM/dd/yy HH:mm".
The nested reason given follows:
Unparseable date: "14-3-10 上午12:00"

----
FTL stack trace ("~" means nesting-related):
	- Failed at: ${CPDefinition_displayDate.getData()?...  [in template "3192443#3192485#null" at line 4, column 9]
----
1<#setting date_format="MMMMM d, yyyy"> 
2 
3<#if (CPDefinition_displayDate.getData())??> 
4	${CPDefinition_displayDate.getData()?datetime("MM/dd/yy HH:mm")?date} 
5</#if> 
Published Date
14-3-10 上午12:00
SUPPORTED OFFERINGS
Self-Hosted, Self-Managed
Supported Versions
6.2, 6.1
Resource Requirements
处理模板时发生错误。
For "." left-hand operand: Expected a hash, but this has evaluated to a string (wrapper: f.t.SimpleScalar):
==> specifications  [in template "3192443#3192485#null" at line 17, column 36]

----
FTL stack trace ("~" means nesting-related):
	- Failed at: #if specifications?has_content && spe...  [in template "3192443#3192485#null" at line 17, column 1]
----
1<#assign 
2	channelId="" 
3	channels=restClient.get("/headless-commerce-delivery-catalog/v1.0/channels") 
4	filteredSpecifications=[] 
5/> 
6 
7<#list channels.items as channel> 
8	<#if channel.name=="Marketplace Channel"> 
9		<#assign channelId = channel.id /> 
10	</#if> 
11</#list> 
12 
13<#if (CPDefinition_cProductId.getData())??> 
14	<#assign specifications = restClient.get("/headless-commerce-delivery-catalog/v1.0/channels/" + channelId + "/products/" + CPDefinition_cProductId.getData() + "/product-specifications") /> 
15</#if> 
16 
17<#if specifications?has_content && specifications.items?has_content> 
18 
19	<#assign 
20		cpuQuantity = "" 
21		memoryQuantity = "" 
22	/> 
23 
24	<#list specifications.items?sort_by("specificationKey") as specification> 
25		<#if stringUtil.equals(specification.value, "cloud")> 
26		    <script> 
27		        var resourceRequirements = document.querySelector(".marketplace-resource-requirements") 
28						 
29						resourceRequirements.classList.remove("d-none"); 
30		    </script> 
31		</#if> 
32		 
33		<#if specification.specificationKey?has_content && (stringUtil.equals(specification.specificationKey, "cpu") || stringUtil.equals(specification.specificationKey, "ram"))> 
34			<#if stringUtil.equals(specification.specificationKey, "cpu" )> 
35				<#assign cpuQuantity = specification.value /> 
36 
37				<#if cpuQuantity?has_content> 
38					${cpuQuantity} 
39					<#if cpuQuantity?eval gt 1> 
40						CPUS 
41					</#if> 
42					<#if cpuQuantity?eval lt 2> 
43						CPU 
44					</#if> 
45				</#if> 
46			</#if> 
47 
48			<#if stringUtil.equals(specification.specificationKey, "ram")> 
49				<#assign memoryQuantity = specification.value /> 
50 
51				<#if cpuQuantity?has_content && memoryQuantity?has_content >,</#if> 
52			</#if> 
53 
54			<#if stringUtil.equals(specification.specificationKey, "ram")> 
55				<#assign memoryQuantity = specification.value /> 
56 
57				<#if memoryQuantity?has_content> 
58					${memoryQuantity} GB RAM 
59				</#if> 
60			</#if> 
61		</#if> 
62	</#list> 
63</#if> 
Edition
CE, EE
PRICE
处理模板时发生错误。
For "." left-hand operand: Expected a hash, but this has evaluated to a string (wrapper: f.t.SimpleScalar):
==> specifications  [in template "3192443#3192485#null" at line 16, column 36]

----
FTL stack trace ("~" means nesting-related):
	- Failed at: #if specifications?has_content && spe...  [in template "3192443#3192485#null" at line 16, column 1]
----
1<#assign 
2	channelId="" 
3	channels=restClient.get("/headless-commerce-delivery-catalog/v1.0/channels") 
4	filteredSpecifications=[] /> 
5 
6<#list channels.items as channel> 
7	<#if channel.name=="Marketplace Channel"> 
8		<#assign channelId = channel.id /> 
9	</#if> 
10</#list> 
11 
12<#if (CPDefinition_cProductId.getData())??> 
13	<#assign specifications = restClient.get("/headless-commerce-delivery-catalog/v1.0/channels/" + channelId + "/products/" + CPDefinition_cProductId.getData() + "/product-specifications") /> 
14</#if> 
15 
16<#if specifications?has_content && specifications.items?has_content> 
17	<#list specifications.items?sort_by("specificationKey") as specification> 
18		<#if specification.specificationKey?has_content> 
19			<#if stringUtil.equals(specification.specificationKey, "price-model" )> 
20				<#assign priceModel = specification.value /> 
21				<#if priceModel?has_content> 
22					${priceModel} 
23				</#if> 
24			</#if> 
25		</#if> 
26	</#list> 
27</#if> 
help & support
Terms & Conditions
SHARE LINK
Copy & Share Link

HTML Example

A paragraph is a self-contained unit of a discourse in writing dealing with a particular point or idea. Paragraphs are usually an expected part of formal writing, used to organize longer prose.