1

In Liferay 6 it was possible to get various types of links, for example you could get CreateAccount link from themeDiplay by using themeDisplay.getURLCreateAccount().toString(). Check this link

Recently I've migrated to Liferay 7. In my custom theme when I am working with .ftl files I'd like to have create account link but I can't find any suitable methods for it. Although you can find getURLSignIn() and getURLSignOut. Check this link

Is there any chance to find a create account url by themeDisplay? If not what should I do?

Elyas Hadizadeh
  • 3,289
  • 8
  • 40
  • 54

2 Answers2

5

For theme freemaker template, you can use following.

<#assign plid = layout.getPlid()>
<#assign createAccountURL = portletURLFactory.create(request,"com_liferay_login_web_portlet_LoginPortlet",plid,"RENDER_PHASE")>
${createAccountURL.setParameter("mvcRenderCommandName", "/login/create_account")}
${createAccountURL.setParameter("p_p_state", "maximized")}
${createAccountURL.setParameter("p_p_mode", "view")}

<a href="${createAccountURL}"> Create Account </a>
Rajesh
  • 400
  • 3
  • 7
0

Use action commands in Liferay 7 to call the create account in the JSP

Example :

https://dev.liferay.com/develop/tutorials/-/knowledge_base/7-0/mvc-action-command

Syed Ali
  • 21
  • 3