Ask Questions and Find Answers
Important:
Ask is now read-only. You can review any existing questions and answers, but not add anything new.
But - don't panic! While ask is no more, we've replaced it with discuss - the new Liferay Discussion Forum! Read more here here or just visit the site here:
discuss.liferay.com
RE: Liferay 7.2 - How to show my web content?
Hi,
I am trying to create a hyperlink to my web content and I read that you can do it like this:
But when I clink my hyperlink I get redirected to something like this:
Could that "56" be a wrong ID? What would be the correct way to show my web content in a new page?
I am trying to create a hyperlink to my web content and I read that you can do it like this:
themeDisplay.getURLCurrent() + "/-/journal_content/56/" + journalArticle.getGroupId() + "/" + journalArticle.getArticleId();
But when I clink my hyperlink I get redirected to something like this:

Could that "56" be a wrong ID? What would be the correct way to show my web content in a new page?
What's wrong with just using the Webcontent display portlet that comes with Liferay? Or, if you want dynamic selection of the content, the Asset Publisher portlet that comes with Liferay?
On top of what Fernando says: An ID like "56" points to 6.x versions - You're asking for 7.2 and the ids have changed dramatically. "56" definitely is not a correct id any more.
Hi Fernando and Olaf,
This is a dynamic selection, so I was trying to create a page on the fly to show my Journal Article. The only examples that I found was by creating the URL with this ID that only works on Liferay 6.
So if I understood correctly, the solution is to use the Asset Publisher for dynamic web content selection is that right? Are there any examples on how to do this?
Thanks!
This is a dynamic selection, so I was trying to create a page on the fly to show my Journal Article. The only examples that I found was by creating the URL with this ID that only works on Liferay 6.
So if I understood correctly, the solution is to use the Asset Publisher for dynamic web content selection is that right? Are there any examples on how to do this?
Thanks!
Fabio Carvalho:
It all depends on the "dynamic selection": That's not a concept where those two words seem to be enough.
This is a dynamic selection, so I was trying to create a page on the fly to show my Journal Article. The only examples that I found was by creating the URL with this ID that only works on Liferay 6.
So if I understood correctly, the solution is to use the Asset Publisher for dynamic web content selection is that right? Are there any examples on how to do this?
You may try to configure an AssetPublisher and look for its mechanics to show a single article, e.g. in the detail view.
To create objects of my model class I am doing like this:
Then on my view.jsp:
What I mean by "dynamic selection" is that I create a list in my container, and each item should have a different URL. What I want to do is to redirect to a page with the content of the JournalArticle.
public DataSource(JournalArticle journalArticle) throws PortalException {
targetURL = journalArticle.getUrlTitle();
}
Then on my view.jsp:
<aui:container>
<% for (int i = 0; i < dataSources.size(); i++) { %>
<a href="<%= dataSources.get(i).getTargetURL() %>"> Some Journal Article Text </a>
<% } %>
</aui:container>
What I mean by "dynamic selection" is that I create a list in my container, and each item should have a different URL. What I want to do is to redirect to a page with the content of the JournalArticle.
Fabio Carvalho:
That's precisely what AssetPublisher does: First dynamically filtering any number of articles, shows them (optionally) in an abbreviated (abstract) form, and provides a link to view everything. That link is to a page that contains the full article.
What I mean by "dynamic selection" is that I create a list in my container, and each item should have a different URL. What I want to do is to redirect to a page with the content of the JournalArticle.
Note: Articles also can have a Display Page, which is a page with an AssetPublisher marked as Default: This way you can determine where on the page the article is shown, and even show other content on the same page.
I'd say: Look at AssetPublisher - if only for link generation. Also look at Display Pages - see if they can do the job for you.
Hi Olaf,
I went with the Display Pages option and seems to be what I want. I didn't know what Display Pages were supposed to do before.
Thanks a lot!
I went with the Display Pages option and seems to be what I want. I didn't know what Display Pages were supposed to do before.
Thanks a lot!
Copyright © 2025 Liferay, Inc
• Privacy Policy
Powered by Liferay™