(Opens New Window)
Mark as an Answer
Blogs 'Attach Files' Feature - Liferay 6.0.6 CE
May 27, 2012 11:44 PM
Rank: New Member
Join Date: January 5, 2012
I am new to Liferay and need to customize the Blogs Portlet to add the 'Attach Files' feature similar to that in the Message Boards Portlet. Can you please guide me in doing so?
- Liferay CE 6.0.6
- HSQL database (for my testing)
What I am planning to do?
- customize the Blogs Portlet to add the 'Attach Files' feature similar to that in the Message Boards / Forums Portlet.
What steps I have taken now?
- Added 'Attach Files' button to the Blogs Portlet.
- Followed the implementation of Message Boards and literally have copied the code to Blogs (Sorry, I don't have any experience in develping front end, but I am a core java person).
My changes are In edit_entry.jsp,
String taglibOnClick = "document." + renderResponse.getNamespace() + "fm." + renderResponse.getNamespace() + "content.value = " + renderResponse.getNamespace() + "getHTML(); document." + renderResponse.getNamespace() + "fm." + renderResponse.getNamespace() + "attachments.value = '" + !attachments + "'; submitForm(document." + renderResponse.getNamespace() + "fm);";
<aui:button onClick="<%= taglibOnClick %>" value='<%= ((attachments) ? "remove" : "attach") + "-files" %>' />
The 'attachments' boolean variable is false initially, but when this form is submitted the value should be set to true. I tried my level best to google this but I didn't find a valid answer.
Please guide me.
Thanks & Regards,
Sign in to vote.
Please sign in to flag this as inappropriate.