简体   繁体   中英

Liferay 6 - Displaying a web content page

I'm using Liferay for the first time at my job and I'm finding it difficult to do what at first glance seemed like an easy scenario. I've just been going over countless forms and tutorials but non of them have given me the full scope or path to the solution. So here's what I'm trying to accomplish. I created a simple HTML message using Web Content that displays a message and has some pictures inside of it. When I preview this Web Content on the Control Panel it looks great. Now I just want to show this Web Content in a portal on my page. The portal will only show this single Asset (I believe its's called). So I created a 'page' of type 'Content Display Page'. I then went back to my Web Content and configured it's 'Display Page' to be the page I just created. When I go to check out my site I see a new tab on the navigation bar that has the name of the page I just created, but when I click on it, it shows a search box and under that it says "Asset Publisher" and shows all the assets we have.

How can I get this page/portal/tab to only show the single Web Content asset that I want? I keep seeing things in some tutorials about the Asset Publisher but I don't see it anywhere in the Control Panel, the only time I've seen anything that says Asset Publisher is on my actual site like I mentioned above.

I know this post is really vague, and I usually wouldn't make a post like this, but I've kind of hit a wall here. Nothing I've found has seemed entirely relevant and/or they tell me to do things on the Control Panel that I don't see. If at the very least you could point me to some documentation or tutorials that explain very clearly how to do this I would greatly appreciate that.

I've also tried just using velocity to download the Web Content directly and not use a 'page' but that didn't yield any results and after reading further I got the impression that you're supposed to use Web Content with a page and not just display Web Content directly; is that true? I'm open to any solution that gets the single Web Content Asset on my site.

Resource that I used to try and display the Web Content directly: http://www.e-kon.be/blog/item/two-ways-to-embed-web-content-in-liferay-themes

One of many resources I used to try and display the Web Content in it's own page: https://dev.liferay.com/discover/portal/-/knowledge_base/6-2/features-of-liferays-wcm

As described in the comments and chat: If you want to show one specific article on a page, you don't need to use the "Content Display Page" concept, rather create the page (choose "Empty Page"), choose a layout and add a "Web Content Display" portlet to the page (you can drag and drop it around). Then choose the article that you'd like to display in the "Web Content Display" portlet and the article is there.

Asset Publisher is quite a powerful tool, but you'd typically use it for a more dynamic choice of articles to show: You'll give it criteria which article(s) you want to see (that's why it shows "all" articles - because there's no criteria by default, just a numerical limit of, I believe, 20 articles). It's probably not the best choice to use Asset Publisher your first contact with Liferay, and it's not necessary in the case that you describe.

You'll actually find quite a lot of documentation about Asset Publisher as well as Content Display Pages if you're looking for it. However, Liferay is a powerful and complex product, and the documentation might require some conceptual knowledge - so if this is the first introduction you read, it might not be the right place to go.

There's a trainer-led training course that provides quite a lot of valuable information for getting started - as you state that you're using Liferay in a company environment, it might be a good idea. (Disclaimer: I'm one of Liferay's Trainers - but I've seen great success of exactly that course, kickstarting a huge number of people into a deeper understanding of the platform - knowing these topics can help you get the most out of it)

I will try to elaborate in steps:

1. Create Page:

On clicking Add (+ button), panel will appear on left side, select Page from top menu in panel. Specify name of your page and select Empty Page (Type) and click Add Page button. Your newly created page will appear in the navigation if you didn't tick the Hide from Navigation Menu checkbox. Click on the link of the page you created from navigation to navigate.

2. Add Portlet:

Again click on Add (+ button), select Application from top menu in the panel. In Highlighted section Web Content Display portlet will be appearing(if not, type in the field below menu). Drag this portlet to the page or click on Add option on hovering it.

3. Select Web Content:

Click on Select Web Content link beside gear / settings icon of the portlet, portlet's configuration pop-up will appear. Here all of your created contents will be appearing in table. Select your desired content and click Save button.

That's it, close configuration pop-up, and your content will be appearing on the page.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM