留言板

Creating a link to portlet

David Knol,修改在7 年前。

Creating a link to portlet

Junior Member 帖子: 29 加入日期: 15-6-19 最近的帖子
Hi,
I would like to create a link to one of the Liferay's portlets. I'd like to add in my theme a link, which is invoking "Add bookmark" form from Bookmarks Portlet. How can I achieve that i my freemarker template?
thumbnail
Milen Dyankov,修改在7 年前。

RE: Creating a link to portlet

Expert 帖子: 310 加入日期: 12-10-30 最近的帖子
I'd suggest to create a portlet that
  • renders the link (or whatever you need)
  • uses BookmarksEntryLocalService to save the bookmark

Then you can embed this portlet in your theme.
David Knol,修改在7 年前。

RE: Creating a link to portlet

Junior Member 帖子: 29 加入日期: 15-6-19 最近的帖子
So there's no way to call directly Bookmarks portlet?
thumbnail
Milen Dyankov,修改在7 年前。

RE: Creating a link to portlet (答复)

Expert 帖子: 310 加入日期: 12-10-30 最近的帖子
There is. You need to place the portlet on some public page and construct Action URL to it. But then when you click on the link you'd go to that page. Having custom portlet is just much cleaner way to solve the same problem. Alternatively you could simply have the link call it's jsonws service (see http://<YOUR_DOMAIN>/api/jsonws?contextName=bookmarks)