掲示板

Linking web content

11年前 に Bernardo García Vila によって更新されました。

Linking web content

New Member 投稿: 9 参加年月日: 12/08/02 最新の投稿
Hello there,

we're doing a migration from a custom website to Liferay, and we are stuck with an approach problem. We have some pages were we show a series of links. Those links can point to external and internal urls, or to final leaves with HTML code. To model it we have thought about using the Web Content portlet.

The problem is if we create a link to another web content inside of LFR, when the user clicks on it we lose the own Liferay frame. How can we solve this navegation problem?

For instance, we'd add in a page a link to some other content (something like "http://localhost:8080/c/journal/view_article_content?groupId=10180&articleId=12103"). We want to keep the focus on the Web Content Display portlet when you click that link, moving forward to that link which will allow to navigate to other urls.

We supose Liferay offers some tool or solution for this use case, but we haven't found it yet. Hope the explanation is understandable.

Thanks and regards.
thumbnail
11年前 に Amit Doshi によって更新されました。

RE: Linking web content

Liferay Master 投稿: 550 参加年月日: 10/12/29 最新の投稿
Hi Bernardo,

By Using journalArticleLocalService and journalContentUtil in template, you can achieve it.

Before using service make sure you have this property set in portal-ext.properties.

journal.template.velocity.restricted.variables=

And in Template Use the Service of Journal Article and try to load the Content dynamically.

Below is the example of loading journal article dynamically for one of my project. you can take a hint and start further on it.



#set ($journalArticleLocalService = $serviceLocator.findService("com.liferay.portlet.journal.service.JournalArticleLocalService"))
#set ($journalContentUtil = $utiLocator.findUtil("com.liferay.portlet.journalcontent.util.JournalContentUtil"))
#set ($journalArticle = $journalArticleLocalService.getLatestArticleByUrlTitle($themeDisplay.getScopeGroupId(),$footerMenuURLTitle, 0))
 $journalContentUtil.getContent($group_id, $journalArticle.getArticleId() ,null,$locale.toString(),$theme_display)


Hope it helps.

Thanks & Regards,
Amit Doshi
11年前 に Bernardo García Vila によって更新されました。

RE: Linking web content

New Member 投稿: 9 参加年月日: 12/08/02 最新の投稿
Thank you so much, Amit!

I was assigned to a different project for a while so I had to put this on hold. I'll probably resume it this next week, so thanks again for your solution.

Another question floating through my mind is: is there any way of keeping the ids of those articles in a migration? We're initially setting up a test environment and it would be very nice if we could export it to the production unit without having to change every link again.

Thanks & regards.
thumbnail
11年前 に Amit Doshi によって更新されました。

RE: Linking web content

Liferay Master 投稿: 550 参加年月日: 10/12/29 最新の投稿
Hi Bernardo,

I don't think ID will change if you are migrating the DB. Because we are migrating the DB as we want all our data as it is otherwise no use of migrating. we don't want to loose our data that is why we are migrating . And the above solution that I specified of Journal Article will not make any difference because we are fetching journalarticle with title. so journal article title should remain the same.

Hope this information will be useful for you.


Thanks & Regards,
Amit Doshi
11年前 に Saurabh Gupta によって更新されました。

RE: Linking web content

New Member 投稿: 23 参加年月日: 12/09/24 最新の投稿
Hi ,
i am totally new in liferay. i have requirment like , in one page there is so many link is there and on click on link any i need to load the data dynamically from the database and data should be come according to which link i click . i am not able think how to do this in liferay. i read your post but i don't know where should i add the property . can give me the step to do this. plz give me guidance for this . Thank you in advance.
10年前 に Seeya S Kudtarker によって更新されました。

RE: Linking web content

Regular Member 投稿: 187 参加年月日: 13/01/16 最新の投稿
Hello there,

we're doing a migration from a custom website to Liferay, and we are stuck with an approach problem. We have some pages were we show a series of links. Those links can point to external and internal urls, or to final leaves with HTML code. To model it we have thought about using the Web Content portlet.

The problem is if we create a link to another web content inside of LFR, when the user clicks on it we lose the own Liferay frame. How can we solve this navegation problem?

For instance, we'd add in a page a link to some other content (something like "http://localhost:8080/c/journal/view_article_content?groupId=10180&articleId=12103"). We want to keep the focus on the Web Content Display portlet when you click that link, moving forward to that link which will allow to navigate to other urls.

We supose Liferay offers some tool or solution for this use case, but we haven't found it yet. Hope the explanation is understandable.

Thanks and regards.