If you’re just getting involved with Liferay, you may have come across an interesting portlet called the asset publisher. There are so many different ways to configure this portlet so that it displays content differently. I’ll try to show you how to configure the asset publisher so that it looks more like a familiar real world example.
Here’s a screenshot of a site you may have wasted countless hours on.
You can do this basic functionality in Liferay using two portlets and without having to write any code. Just some cut and paste and a little configuration. It’s not exactly the same but you can see the potential in this portlet, thus unlocking the asset publisher. Here is the Liferay version of the site.
First, I created different pages for the different categories under the “Filter By” section. Notice that I changed the friendly URL to show the title of the page too.
Filter By Content
Next, I created the “Filter By” content using the journal content portlet. I created 4 of these journal articles and placed each one of them on their respective page with the correct friendly URL.
Categories: Featured | Most Recent | Most Viewed | All
Link each of these words with each of the Friendly URLs you just created. I didn’t link “featured” because this is the current page that I’m on.
*Don’t forget to change the title of the portlet from Journal Content to “Featured” by clicking on the portlet title.
Featured Video Content
Configuring the Asset Publisher
Now on to configuring the Asset Publisher to display the right categorized content for each of my pages. I clicked on the gear icon on my Asset Publisher. Assuming that I’m on the “Featured” page, I chose “Journal Article” for Asset Type and added featured and videos as tags and also chose the search operator as “And”. *Remember to save.
Then I clicked on display settings, for display style I chose abstract for display style and for order by column 1, I chose create date descending (so that it would show the most recent videos created first that would also have the tags videos and featured). Here you can try testing out different combinations and most of the options are self-explanatory. I also enabled comments and ratings too. Click save.
Now the asset publisher displays my video “Liferay Portal in Ten Minutes”. I also changed the title to Featured Videos.
Click on the link “Liferay Portal in Ten Minutes and you’ll see this:
Now, just configure all of your asset publishers to display the correct content for each of your pages and woohoo you just duplicated YouTube…well sort of. =)