Forums

Home » Liferay Portal » English » 3. Development

Combination View Flat View Tree View
Threads [ Previous | Next ]
toggle
kumar Raju
How to get url of webcontent to screen.
February 3, 2013 7:59 PM
Answer

kumar Raju

Rank: New Member

Posts: 17

Join Date: September 27, 2012

Recent Posts

Hi All,

I have requirement to get content in liferay (i.e Webcontent).

I am able to fetch the web content name & summary (please refer attached snapshot), not able to get the url.

Can you please tell me how to get the url of web content to screen. On fetching the url to screen, by clicking it should open that webcontent.


Thanks & Regards
Kumar
Attachment

Attachments: ContentSearch.png (9.9k)
kumar Raju
RE: How to get url of webcontent to screen.
February 3, 2013 8:01 PM
Answer

kumar Raju

Rank: New Member

Posts: 17

Join Date: September 27, 2012

Recent Posts

In assetEntry : there is attribute "url" which is getting empty.

Can you guys give some inputs from where the attribute "url" is coming & how to get the "url" of the Content.
Rahul Sharma
RE: How to get url of webcontent to screen.
February 4, 2013 12:41 AM
Answer

Rahul Sharma

Rank: Junior Member

Posts: 60

Join Date: January 10, 2012

Recent Posts

The simpler approach is that you can first click on the link of any of the webcontent, this will open the webcontent in the page then just take the current url by using PortalUtil.getCurrentUrl(),and in this url find for the parameter such as articleId and community Id/group Id,remove unneccessary parameters from this url and replace the article id which you had already got in your code for displaying different content and then use this new url.

Hope that helps!