Ely*_*deh 1 liferay liferay-theme liferay-7 liferay-dxp
在 Liferay 6 中,可以获取各种类型的链接,例如,您可以使用 从 themeDiplay 获取 CreateAccount 链接themeDisplay.getURLCreateAccount().toString()。检查这个链接
最近我已经迁移到 Liferay 7。在我的自定义主题中,当我处理.ftl我想要的文件时create account link,但我找不到任何合适的方法。虽然你可以找到getURLSignIn()和getURLSignOut。检查这个链接
有没有机会通过 themeDisplay 找到创建帐户的 url?如果不是我该怎么办?
小智 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>
Run Code Online (Sandbox Code Playgroud)