Fórumok

Create-account URL in Velocity template (Liferay 6.1)

Thibault Boyeux, módosítva 12 év-val korábban

Create-account URL in Velocity template (Liferay 6.1)

New Member Bejegyzések: 12 Csatlakozás dátuma: 2009.07.27. Legújabb bejegyzések
Hello everyone,

In Liferay 6.1, you can no longer do themeDisplay.getURLCreateAccount() to create a link towards the account creation page in your Velocity theme template.

Indeed, the method has been removed from the ThemeDisplay API.

How could I include this link within my theme Velocity template now that this is not available any longer?

Thank you very much for your help!
thumbnail
Sandeep Nair, módosítva 12 év-val korábban

RE: Create-account URL in Velocity template (Liferay 6.1)

Liferay Legend Bejegyzések: 1744 Csatlakozás dátuma: 2008.11.06. Legújabb bejegyzések
Hi,

Can you try like this in your vm

#set ($create_account_url = $portletURLFactory.create($request, "58", $page.getPlid(), "ACTION_PHASE"))
$create_account_url.setWindowState(WindowState.MAXIMIZED);
$create_account_url.setPortletMode(PortletMode.VIEW);
$create_account_url.setParameter("saveLastPath", "0");
$create_account_url.setParameter("struts_action", "/login/create_account");

and then use $create_account_url

Regards,
Sandeep
Thibault Boyeux, módosítva 12 év-val korábban

RE: Create-account URL in Velocity template (Liferay 6.1)

New Member Bejegyzések: 12 Csatlakozás dátuma: 2009.07.27. Legújabb bejegyzések
Hi Sandeep,

Thank you very much for your precious help. I didin't know one could PortletURLFactory in Velocity (I should have checked the VelocityVariables file, my mistake).

I ended up using this code:

#set ($create_account_url = $portletURLFactory.create($request, "58", $page.getPlid(), "ACTION_PHASE"))
$create_account_url.setWindowState("maximized")
$create_account_url.setPortletMode("view")
$create_account_url.setParameter("saveLastPath", "0")
$create_account_url.setParameter("struts_action", "/login/create_account")


Indeed, Velocity cannot easily retrieve static constants from Java classes (or I don't know how), such as WindowState.MAXIMIZED and PortletMode.VIEW.

It is not optimal to write them directly as strings, but I think the string values of these two constants shouldn't change soon!


Best,
Thibault.
thumbnail
Tanaji M. Londhe, módosítva 11 év-val korábban

RE: Create-account URL in Velocity template (Liferay 6.1)

Regular Member Bejegyzések: 194 Csatlakozás dátuma: 2012.04.25. Legújabb bejegyzések
Hi,

Liferay 6.1 version does not support "themeDisplay.getURLCreateAccount()" ,so I used following code as it is in my vm file but cant work
#set ($create_account_url = $portletURLFactory.create($request, "58", $page.getPlid(), "ACTION_PHASE"))
$create_account_url.setWindowState(WindowState.MAXIMIZED);
$create_account_url.setPortletMode(PortletMode.VIEW);
$create_account_url.setParameter("saveLastPath", "0");
$create_account_url.setParameter("struts_action", "/login/create_account");

So please anybody tell me link for Create-Account URL for liferay 6.1
thumbnail
Sandeep Nair, módosítva 11 év-val korábban

RE: Create-account URL in Velocity template (Liferay 6.1)

Liferay Legend Bejegyzések: 1744 Csatlakozás dátuma: 2008.11.06. Legújabb bejegyzések
Dont use WindowState or PortletMode, use the string values directly as

$create_account_url.setWindowState("maximized")
$create_account_url.setPortletMode("view")
thumbnail
Tanaji M. Londhe, módosítva 11 év-val korábban

RE: Create-account URL in Velocity template (Liferay 6.1)

Regular Member Bejegyzések: 194 Csatlakozás dátuma: 2012.04.25. Legújabb bejegyzések
Hi Sandeep,
I make changes as per your suggestion but generates url this one "http://localhost:9090/create_account_url" , So what is issue i cant find out.

#set ($create_account_url = $portletURLFactory.create($request, "58", $page.getPlid(), "ACTION_PHASE"))
$create_account_url.setWindowState("maximized");
$create_account_url.setPortletMode("view");
$create_account_url.setParameter("saveLastPath", "0");
$create_account_url.setParameter("struts_action", "/login/create_account");

<a href="create_account_url">Register</a>

It throughs exception : 07:25:04,140 INFO [PortalImpl:4873] Current URL /create_account_url generates exception: null



Thanks & regards,
Tanaji Londhe.
thumbnail
Sandeep Nair, módosítva 11 év-val korábban

RE: Create-account URL in Velocity template (Liferay 6.1)

Liferay Legend Bejegyzések: 1744 Csatlakozás dátuma: 2008.11.06. Legújabb bejegyzések
You havent used the variable in anchor tag properly. Please put $
<a href="$create_account_url">Register</a>
thumbnail
Tanaji M. Londhe, módosítva 11 év-val korábban

RE: Create-account URL in Velocity template (Liferay 6.1)

Regular Member Bejegyzések: 194 Csatlakozás dátuma: 2012.04.25. Legújabb bejegyzések
Hi Sandeep,

Sorry I forgot to write "$" in vm file. Thanx it works properly.
Sylvain Fournier, módosítva 11 év-val korábban

RE: Create-account URL in Velocity template (Liferay 6.1)

New Member Bejegyzés: 1 Csatlakozás dátuma: 2012.07.19. Legújabb bejegyzések
How do you manage multi language for your label "Register"
thumbnail
Pablo Rendón, módosítva 11 év-val korábban

RE: Create-account URL in Velocity template (Liferay 6.1)

New Member Bejegyzések: 8 Csatlakozás dátuma: 2011.12.29. Legújabb bejegyzések
Hello,

I'm trying to get the categories with the link in a VM template, but I can't even make this works, this is what I'm doing:

#set ($create_account_url = $portletURLFactory.create($request, "58", $page.getPlid(), "ACTION_PHASE"))
$create_account_url.setWindowState("maximized");
$create_account_url.setPortletMode("view");
$create_account_url.setParameter("saveLastPath", "0");
$create_account_url.setParameter("struts_action", "/login/create_account");

<a href="$create_account_url">Register</a>

and I have a link like "http://localhost:8080/web/guest/$thisportlet_url"
I think is a problem related with the $page, because when I try to render the $page.getPlid() I just get "$page.getPlid()" instead of the value, I've modified the portal-ext.properties to add "journal.template.velocity.restricted.variables=" but still doesn't work emoticon

any clue what I'm doing wrong?

Thank you!
thumbnail
Durgaprasad Lagadapati, módosítva 11 év-val korábban

RE: Create-account URL in Velocity template (Liferay 6.1)

New Member Bejegyzések: 10 Csatlakozás dátuma: 2012.05.25. Legújabb bejegyzések
Can we use LoginUtil.getURLCreateAccount(request,themeDisplay) as suggested in http://www.liferay.com/community/wiki/-/wiki/Main/Upgrade+6.0+plugins+to+6.1?
John Carter, módosítva 11 év-val korábban

RE: Create-account URL in Velocity template (Liferay 6.1)

Junior Member Bejegyzések: 53 Csatlakozás dátuma: 2012.10.18. Legújabb bejegyzések
Durgaprasad Lagadapati:
Can we use LoginUtil.getURLCreateAccount(request,themeDisplay) as suggested in http://www.liferay.com/community/wiki/-/wiki/Main/Upgrade+6.0+plugins+to+6.1?


Durgaprasad,
I have checked the LoginUtil class in LR6.1.1 GA2 there is no such method,but if it's about account url for the login user then you can use
"$theme_display.getURLMyAccount()"

in theme .
Beppo Ivel, módosítva 9 év-val korábban

RE: Create-account URL in Velocity template (Liferay 6.1)

Regular Member Bejegyzések: 112 Csatlakozás dátuma: 2014.04.09. Legújabb bejegyzések
I also tried to build a URL but in I use freemarker template. My question is how I get the variable ${page}? If I try to call:

&lt;#assign updateURL = portletURLFactory.create(request,"169_INSTANCE_X4hfOUKZyDvi", page.getPlid() ,"RENDER_PHASE")&gt;


I get the error:

Expression page is undefined on line 55, column 122 in 10157#10197#11814.
thumbnail
Sandeep Nair, módosítva 9 év-val korábban

RE: Create-account URL in Velocity template (Liferay 6.1)

Liferay Legend Bejegyzések: 1744 Csatlakozás dátuma: 2008.11.06. Legújabb bejegyzések
Replace "page" with "layout".

Regards,
Sandeep
Sriram Moola, módosítva 11 év-val korábban

RE: Create-account URL in Velocity template (Liferay 6.1)

New Member Bejegyzések: 2 Csatlakozás dátuma: 2012.07.20. Legújabb bejegyzések
HI Sandeep,

I've followed your steps in creating account url in velocity template. The url is generating fine, but the problem i'm facing is with a parameter p_p_lifecyle. Below is the url

http://localhost:8080/home?p_auth=1KMIMM5l&p_p_id=58&p_p_lifecycle=1&p_p_state=maximized&p_p_mode=view&saveLastPath=0&_58_struts_action=%2Flogin%2Fcreate_account

It's giving me Sigin is temporarily not available. When i change the p_p_lifecylcle paramter value to 0, it's working fine so can you please suggest me what should i do to set p_p_lifecycle parameter.
Sriram Moola, módosítva 11 év-val korábban

RE: Create-account URL in Velocity template (Liferay 6.1)

New Member Bejegyzések: 2 Csatlakozás dátuma: 2012.07.20. Legújabb bejegyzések
Hi Guys,

I've found the solution for my issue, using RENDER_PHASE instead of ACTION_PHASE fixed the issue.
Beppo Ivel, módosítva 9 év-val korábban

RE: Create-account URL in Velocity template (Liferay 6.1)

Regular Member Bejegyzések: 112 Csatlakozás dátuma: 2014.04.09. Legújabb bejegyzések
I already used RENDER_PHASE, I was looking for themeDisplay.getPlid(). Do you know how to get the themeDisplay.getPortletDisplay().getId()? This question is related to this thread.