Unlocking The Asset Publisher

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.

 

 

Creating Pages

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

To create my video content, I added the asset publisher to each of the 4 pages.  On the asset publisher, on the” Featured Page”, I added a new journal article. Then, I added the title of the video “Liferay Portal in Ten Minutes, I clicked on source and added the embedded javascript code for my video from YouTube.  Then, I added two tags- videos and featured, these tags will be used when I configure my asset publisher.  Under the “Abstract Section”, I added the description for the video that was on YouTube and I also added the thumbnail for the video as well.  I repeated this for all of my videos and I left out the featured tag, if the video wasn’t featured.  You could also add a new tag for a new category.

 

 

 

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. =)

 

Craig

 

7
Blogs
Thank you just what i was looking for emoticon, btw do you know how to get the most rated not just viewed content? thanks nice post!
Hi - thanks for this article.

1. Can I use Velocity in the template to output the value of the tag within the web page for each record that is being displayed ?
Simple and great solution, even we could use the tabs laf of the active liferay theme, e.g. in each webcontent ;
<ul class="tabs ui-tabs">
<li class="current first"><a>Featured</a></li>
<li class=""><a href="../../../../../web/guest/mostviewed">Most Viewed</a></li>
<li class=""><a href="../../../../../web/guest/mostrecent">Most Recent</a></li>
<li class="last"><a href="../../../../../web/guest/home">All</a></li>
</ul>