Fórumok

Unable to access currentURL in CMS/ADT template liferay 6.2

thumbnail
Ranga Rao Bobbili, módosítva 9 év-val korábban

Unable to access currentURL in CMS/ADT template liferay 6.2

Regular Member Bejegyzések: 152 Csatlakozás dátuma: 2007.07.20. Legújabb bejegyzések
Hi All,

I am unable to access currentURL in CMS template using Liferay 6.2 EE GA2.

Right now i am unable to access currentURL using following approach.I couldn't it find $request object/variable in CMS/ADT velocity template.

#set ($current_url = $request.get("attributes").CURRENT_URL) -- not working​


And also I knew themeDisplay,portletDisplay,portletPreferences etc.. not available in CMS/ADT templates.

is $request available in liferay 6.2 CMS/ADT template level? or please provide me the way to get current url in CMS template.

Thanks in advance....................

Regards,
Ranga Rao
thumbnail
Jitendra Rajput, módosítva 9 év-val korábban

RE: Unable to access currentURL in CMS/ADT template liferay 6.2

Liferay Master Bejegyzések: 875 Csatlakozás dátuma: 2011.01.07. Legújabb bejegyzések
Try to print $request object to see available request attributes.


You can also check below classes to see what variables and helper utilities are available in template.

https://github.com/liferay/liferay-portal/blob/6.2.x/portal-impl/src/com/liferay/portal/velocity/VelocityTemplateContextHelper.java

https://github.com/liferay/liferay-portal/blob/6.2.x/portal-impl/src/com/liferay/portal/template/TemplateContextHelper.java
Ranjith Narahari, módosítva 9 év-val korábban

RE: Unable to access currentURL in CMS/ADT template liferay 6.2

New Member Bejegyzések: 21 Csatlakozás dátuma: 2013.01.23. Legújabb bejegyzések
I tried with $request variable print from the template.

getting the value is {}
thumbnail
Jitendra Rajput, módosítva 9 év-val korábban

RE: Unable to access currentURL in CMS/ADT template liferay 6.2

Liferay Master Bejegyzések: 875 Csatlakozás dátuma: 2011.01.07. Legújabb bejegyzések
Not sure but did you tried by setting below property in portal-ext

journal.template.velocity.restricted.variables=
thumbnail
Ranga Rao Bobbili, módosítva 9 év-val korábban

RE: Unable to access currentURL in CMS/ADT template liferay 6.2

Regular Member Bejegyzések: 152 Csatlakozás dátuma: 2007.07.20. Legújabb bejegyzések
Jitendra Rajput:
Not sure but did you tried by setting below property in portal-ext

journal.template.velocity.restricted.variables=


Thanks for quick reply Jitendra Rajput. As per liferay wiki documentation we can restrict only following entries but not request.

portalUtil,portal,prefsPropsUtil,propsUtil,velocityPortletPreferences,serviceLocator,sessionClicks,utilLocator

is this issue related to template cache (I saw Jeffrey Paul Handa forum post, he mentioned template cache option(need to uncheck cacheable checkbox) but i couldn't find cacheable checkbox option in CMS template level)?

guys can you please help me out to resolve this issue.

Thanks in advance.......

Thanks,
Ranga Rao
thumbnail
Ranga Rao Bobbili, módosítva 9 év-val korábban

RE: Unable to access currentURL in CMS/ADT template liferay 6.2

Regular Member Bejegyzések: 152 Csatlakozás dátuma: 2007.07.20. Legújabb bejegyzések
Ranjith Narahari:
I tried with $request variable print from the template.

getting the value is {}


Thanks Ranjith. I am also facing same issue.
thumbnail
Ranga Rao Bobbili, módosítva 9 év-val korábban

RE: Unable to access currentURL in CMS/ADT template liferay 6.2

Regular Member Bejegyzések: 152 Csatlakozás dátuma: 2007.07.20. Legújabb bejegyzések
Hi friends, please help me to resolve the issue.

Thanks,
Ranga Rao
thumbnail
Enrique Valdes Lacasa, módosítva 9 év-val korábban

RE: Unable to access currentURL in CMS/ADT template liferay 6.2

Junior Member Bejegyzések: 92 Csatlakozás dátuma: 2014.07.29. Legújabb bejegyzések
Hello everyone. I am facing the same issue in Liferay 6.2.1 CE. The request variable is showing up as {}. I found some Liferay cases pointing out to similar problems. It is supposed to have been solved for previous versions of Liferay (6.0 and 6.1)...but it seems that a fix for 6.2 is still pending:
https://issues.liferay.com/browse/LPS-32074
https://issues.liferay.com/browse/LPS-51032