« Back

Web Content enhancements

Company Blogs February 10, 2009 By Bruno Farache Staff

The new release brings some cool new features for the Web Content portlet (previously known as Journal portlet), here are some of them:

1. Repeatable Structure fields

Sometimes, while creating a Structure, we can't predict how many fields of a certain type a Web Content entry will need. Now, for each row in a Structure, there is a Repeatable check box:



If I check this checkbox, I can add as many "repeatable-field" as I want while creating my Web Content entry, I just need to click on the plus icon:



Here's the template that I created to list all "repeatable-field", to get all the values I just need to call $repeatable-field.getSiblings() and iterate over them:



And here's the result:



2. Print feature

Go to Web Content Display configuration, click on "Enable Print", a printer icon will appear just below the Web Content Display portlet, when you click on the printer icon, a pop-up shows up the content in a printer-friendly version. But before that, the template being used needs something like:

#if ($viewMode == "view")
    Displaying content normally.
#elseif ($viewMode == "print")
    Displaying the content in a printer friendly fashion.
#end

3. Web Content conversion to PDF, ODT, DOC...

We have this feature for a long time for Wiki and Document Library, we extended it so Web Content entries can be also converted to these formats, you just need to enable OpenOffice integration following this steps:

Document Conversion with OpenOffice

Then, go to Web Content Display configuration and enable the "Convert To" checkboxes.

That's it, hope these features can be useful for you!

Threaded Replies Author Date
Sweet! Thank you, Bruno! Jonas Yuan February 10, 2009 1:38 PM
Great!!! I was expecting this feature since... Ezequiel Chavez February 10, 2009 10:14 PM
i've been using it recently and it works well! ... Wilson Man February 14, 2009 1:42 PM
Hi Bruno. Hi everyone. I have a problem with... Nicola Loda March 26, 2009 3:38 AM
hope next there would email to friend feature.... delang j April 9, 2009 8:13 AM
Can somebody post the code for accessing the... Sophia Cui April 9, 2009 2:57 PM
for structure -----------------... Anil Kumar May 12, 2009 4:52 PM
hi.. can anyone tell me where do i find the wcm... harish p April 13, 2009 6:33 AM
Is there any way to style / add css to the... Andreas Ortner June 29, 2009 5:06 AM
This is a good feature! thanks, Can we also all... Anand Abhyankar July 6, 2009 10:40 PM
Hi, there seems to be a strange behaviour when... Andi Kuhn October 2, 2009 2:02 AM
How do you change the order of a repeatable... Konrad Giæver Beiske October 13, 2009 4:26 AM
Hi, I'd like to know if problems with... Manel Moliner Planes November 27, 2009 7:45 AM
Hi, The repeatable fields is a great... Sylvain ARNAUD January 5, 2010 4:20 AM

Sweet! Thank you, Bruno!
Posted on 2/10/09 1:38 PM.
Great!!! I was expecting this feature since this post http://www.liferay.com/web/guest/community/forums/-/message_boards/message/53858­4, you can check it again there are other features that would be great to add ("Group" type, set the number of repetitions for repeatable fields), Thanx.
Posted on 2/10/09 10:14 PM.
i've been using it recently and it works well! no more title001, title002, title003 ... =)
Posted on 2/14/09 1:42 PM.
Hi Bruno. Hi everyone.
I have a problem with Repeatable Structure fields. I follw the instructions in your post but I can't obtain any result. I think that "getSibilings" method doesn't return any element so variable "$field" is empty and for each statement doesn't cycle.

Thanks in advance
Posted on 3/26/09 3:38 AM.
hope next there would email to friend feature. nice
Posted on 4/9/09 8:13 AM.
Can somebody post the code for accessing the nested repeatable items?
Posted on 4/9/09 2:57 PM.
hi.. can anyone tell me where do i find the wcm api?
Posted on 4/13/09 6:33 AM.
for structure
-----------------
<dynamic-element name='sub_section_title' type='text' repeatable='true'>
<dynamic-element name='sub_section_link_name' type='text' repeatable='true'>
<dynamic-element name='sub_section_link_url' type='text' repeatable='false'> </dynamic-element>
</dynamic-element>
</dynamic-element>


Template code
-----------------------

#foreach ($SubSection in $SectionTitle.sub_section_title.getSiblings())
#if ($SubSection.data != "")
<a href="" onclick="expandMenu('k$velocityCount','key$velocityCount');return false;" id="k$velocityCount">$SubSection.data</a>
<div id="key$velocityCount" style="display:none;" class="sublist">
#foreach ($SubSectionLink in $SubSection.sub_section_link_name.getSiblings())
<a href="$SubSectionLink.sub_section_link_url.data" target="new">- $SubSectionLink.data</a>
#end
</div>
#end
#end
Posted on 5/12/09 4:52 PM in reply to Sophia Cui.
Is there any way to style / add css to the printer friendly content?
Posted on 6/29/09 5:06 AM.
This is a good feature! thanks,
Can we also all any format eg. .doc and let Liferay convert it to .pdf?, so that all documents will in in .pdf format in the Library portlet.
Also, can this be applied to video / audio files also? meaning, user will upload any format (.avi, .wmv etc) and the file will be saved in .swf or .flv by converting in the Library portlet.
Posted on 7/6/09 10:40 PM.
Hi,
there seems to be a strange behaviour when adding new rows - they are always added at the top not the bottom.
So when i have text block and want to add new text, they are always at the top.
Can this behaviour be changed ?
Posted on 10/2/09 2:02 AM.
How do you change the order of a repeatable field without having to re-enter the data?
Posted on 10/13/09 4:26 AM.
Hi,
I'd like to know if problems with repeatable fields are solved.

Thanks
Posted on 11/27/09 7:45 AM.
Hi,

The repeatable fields is a great improvement with 5.2.
It allows much more flexibility in web content structure design.

But it still lacks ordering support, to make it more usable.

Are the any plans to work on that functionnality?
Posted on 1/5/10 4:20 AM.