Forums de discussion

Linking web content

Bernardo García Vila, modifié il y a 11 années.

Linking web content

New Member Publications: 9 Date d'inscription: 02/08/12 Publications récentes
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
Amit Doshi, modifié il y a 11 années.

RE: Linking web content

Liferay Master Publications: 550 Date d'inscription: 29/12/10 Publications récentes
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
Bernardo García Vila, modifié il y a 11 années.

RE: Linking web content

New Member Publications: 9 Date d'inscription: 02/08/12 Publications récentes
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
Amit Doshi, modifié il y a 11 années.

RE: Linking web content

Liferay Master Publications: 550 Date d'inscription: 29/12/10 Publications récentes
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
Saurabh Gupta, modifié il y a 11 années.

RE: Linking web content

New Member Publications: 23 Date d'inscription: 24/09/12 Publications récentes
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.
Seeya S Kudtarker, modifié il y a 10 années.

RE: Linking web content

Regular Member Publications: 187 Date d'inscription: 16/01/13 Publications récentes
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.