Some time we need to access Liferay Services in our theme or Web content Templates. So today we will discuss how to access Liferay Services in our theme and templates.
For Theme
If you want to access liferay services like user services in your theme you can use this code in portal_normal.vm:-
Explanation:-
Here we first get the UserLocalService object and then call getUsersCount method.
For Web Content Templates
You can use the above code in your templates files but you need to do one extra step. Just enter :-
velocity.engine.restricted.variables=
in your portal-ext.properties and restart server.
Hope this will Help....
Related Post:-
Access Custom Services in Velocity(VM) files using Service Locator
Categorization in web content
Structure and Template in Web Content
Fetch Web Content Programmatically
Get Journal Article Using SAX Parser
Form Handling in Spring Portlet
Embedding a Web Content in a Portlet
Fetch Latest Version Journal Article or Web Content in Liferay
Related Post:-
Access Custom Services in Velocity(VM) files using Service Locator
Categorization in web content
Structure and Template in Web Content
Fetch Web Content Programmatically
Get Journal Article Using SAX Parser
Form Handling in Spring Portlet
Embedding a Web Content in a Portlet
Fetch Latest Version Journal Article or Web Content in Liferay
No comments:
Post a Comment