Combination View Flat View Tree View
Threads [ Previous | Next ]
toggle
Create-account URL in Velocity template (Liferay 6.1) Thibault Boyeux February 19, 2012 11:57 AM
RE: Create-account URL in Velocity template (Liferay 6.1) Sandeep Nair February 19, 2012 10:53 PM
RE: Create-account URL in Velocity template (Liferay 6.1) Thibault Boyeux February 20, 2012 12:41 PM
RE: Create-account URL in Velocity template (Liferay 6.1) Tanaji Londhe July 5, 2012 11:02 PM
RE: Create-account URL in Velocity template (Liferay 6.1) Sandeep Nair July 5, 2012 11:41 PM
RE: Create-account URL in Velocity template (Liferay 6.1) Tanaji Londhe July 6, 2012 12:33 AM
RE: Create-account URL in Velocity template (Liferay 6.1) Sandeep Nair July 6, 2012 1:11 AM
RE: Create-account URL in Velocity template (Liferay 6.1) Tanaji Londhe July 6, 2012 1:25 AM
RE: Create-account URL in Velocity template (Liferay 6.1) Sylvain Fournier July 19, 2012 10:50 AM
RE: Create-account URL in Velocity template (Liferay 6.1) Pablo Rendón August 21, 2012 8:16 AM
RE: Create-account URL in Velocity template (Liferay 6.1) Durgaprasad Lagadapati October 30, 2012 9:20 AM
RE: Create-account URL in Velocity template (Liferay 6.1) parikshit sharma November 5, 2012 4:14 AM
RE: Create-account URL in Velocity template (Liferay 6.1) Beppo Ivel August 1, 2014 1:27 AM
RE: Create-account URL in Velocity template (Liferay 6.1) Sandeep Nair August 15, 2014 4:06 PM
RE: Create-account URL in Velocity template (Liferay 6.1) Sriram Moola July 19, 2012 10:37 PM
RE: Create-account URL in Velocity template (Liferay 6.1) Sriram Moola July 21, 2012 8:10 AM
RE: Create-account URL in Velocity template (Liferay 6.1) Beppo Ivel August 16, 2014 7:32 AM
Thibault Boyeux
Create-account URL in Velocity template (Liferay 6.1)
February 19, 2012 11:57 AM
Answer

Thibault Boyeux

Rank: New Member

Posts: 12

Join Date: July 27, 2009

Recent Posts

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!
Sandeep Nair
RE: Create-account URL in Velocity template (Liferay 6.1)
February 19, 2012 10:53 PM
Answer

Sandeep Nair

Rank: Liferay Legend

Posts: 1721

Join Date: November 5, 2008

Recent Posts

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
RE: Create-account URL in Velocity template (Liferay 6.1)
February 20, 2012 12:41 PM
Answer

Thibault Boyeux

Rank: New Member

Posts: 12

Join Date: July 27, 2009

Recent Posts

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.
Tanaji Londhe
RE: Create-account URL in Velocity template (Liferay 6.1)
July 5, 2012 11:02 PM
Answer

Tanaji Londhe

Rank: Regular Member

Posts: 196

Join Date: April 25, 2012

Recent Posts

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
Sandeep Nair
RE: Create-account URL in Velocity template (Liferay 6.1)
July 5, 2012 11:41 PM
Answer

Sandeep Nair

Rank: Liferay Legend

Posts: 1721

Join Date: November 5, 2008

Recent Posts

Dont use WindowState or PortletMode, use the string values directly as

$create_account_url.setWindowState("maximized")
$create_account_url.setPortletMode("view")
Tanaji Londhe
RE: Create-account URL in Velocity template (Liferay 6.1)
July 6, 2012 12:33 AM
Answer

Tanaji Londhe

Rank: Regular Member

Posts: 196

Join Date: April 25, 2012

Recent Posts

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.
Sandeep Nair
RE: Create-account URL in Velocity template (Liferay 6.1)
July 6, 2012 1:11 AM
Answer

Sandeep Nair

Rank: Liferay Legend

Posts: 1721

Join Date: November 5, 2008

Recent Posts

You havent used the variable in anchor tag properly. Please put $
<a href="$create_account_url">Register</a>
Tanaji Londhe
RE: Create-account URL in Velocity template (Liferay 6.1)
July 6, 2012 1:25 AM
Answer

Tanaji Londhe

Rank: Regular Member

Posts: 196

Join Date: April 25, 2012

Recent Posts

Hi Sandeep,

Sorry I forgot to write "$" in vm file. Thanx it works properly.
Sylvain Fournier
RE: Create-account URL in Velocity template (Liferay 6.1)
July 19, 2012 10:50 AM
Answer

Sylvain Fournier

Rank: New Member

Posts: 1

Join Date: July 19, 2012

Recent Posts

How do you manage multi language for your label "Register"
Sriram Moola
RE: Create-account URL in Velocity template (Liferay 6.1)
July 19, 2012 10:37 PM
Answer

Sriram Moola

Rank: New Member

Posts: 2

Join Date: July 19, 2012

Recent Posts

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
RE: Create-account URL in Velocity template (Liferay 6.1)
July 21, 2012 8:10 AM
Answer

Sriram Moola

Rank: New Member

Posts: 2

Join Date: July 19, 2012

Recent Posts

Hi Guys,

I've found the solution for my issue, using RENDER_PHASE instead of ACTION_PHASE fixed the issue.
Pablo Rendón
RE: Create-account URL in Velocity template (Liferay 6.1)
August 21, 2012 8:16 AM
Answer

Pablo Rendón

Rank: New Member

Posts: 8

Join Date: December 29, 2011

Recent Posts

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!
Durgaprasad Lagadapati
RE: Create-account URL in Velocity template (Liferay 6.1)
October 30, 2012 9:20 AM
Answer

Durgaprasad Lagadapati

Rank: New Member

Posts: 10

Join Date: May 25, 2012

Recent Posts

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?
parikshit sharma
RE: Create-account URL in Velocity template (Liferay 6.1)
November 5, 2012 4:14 AM
Answer

parikshit sharma

Rank: Junior Member

Posts: 48

Join Date: October 18, 2012

Recent Posts

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
RE: Create-account URL in Velocity template (Liferay 6.1)
August 1, 2014 1:27 AM
Answer

Beppo Ivel

Rank: Regular Member

Posts: 112

Join Date: April 9, 2014

Recent Posts

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:

1<#assign updateURL = portletURLFactory.create(request,"169_INSTANCE_X4hfOUKZyDvi", page.getPlid() ,"RENDER_PHASE")>


I get the error:

Expression page is undefined on line 55, column 122 in 10157#10197#11814.
Sandeep Nair
RE: Create-account URL in Velocity template (Liferay 6.1)
August 15, 2014 4:06 PM
Answer

Sandeep Nair

Rank: Liferay Legend

Posts: 1721

Join Date: November 5, 2008

Recent Posts

Replace "page" with "layout".

Regards,
Sandeep
Beppo Ivel
RE: Create-account URL in Velocity template (Liferay 6.1)
August 16, 2014 7:32 AM
Answer

Beppo Ivel

Rank: Regular Member

Posts: 112

Join Date: April 9, 2014

Recent Posts

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.