I’m currently experimenting with using Portlets in layout templates for Liferay 6.0.5, and I’m having a bit of trouble. I’ve tried following a number of tutorials, including the examples available on the Liferay Wiki: http://www.liferay.com/community/wiki/-/wiki/Main/Add+runtime+portlets+to+a+layout#section-Add+runtime+portlets+to+a+layout-Related+Articles. The problem is, none of these examples work correctly for me. The calls to $processor.processPortlet do nothing; An empty cell is produced by my layout template.
My code in my template is as follows:
<div class="columns-1-2" id="main-content" role="main">
#if ($browserSniffer.isIe($request) && $browserSniffer.getMajorVersion($request) < 8)
<table class="portlet-layout">
<tr>
<td class="portlet-column portlet-column-only" id="column-1">
$processor.processPortlet("currentPatient_WAR_opportalweb_INSTANCE_r2Be")
$processor.processColumn("column-1", "portlet-column-content portlet-column-content-only")
</td>
</tr>
</table>
......
#end
</div>
I should also stress that although the call to this portlet is to an instance-able custom portlet, I’ve tried numerous other types of calls to non-instance-able portlets, and even Liferay’s stock portlets:
$processor.processPortlet("tabs_WAR_tabsportlet")
$processor.processPortlet("58")
None of these calls work for me.
I’ve reviewed the liferay logs, and there are no errors in the logs relating to this template, the loading of pages using this template, my syntax, etc. I’m wondering if either the syntax for this particular call has changed in Liferay 6, or if there is some setting I need to adjust in my environment to enable this functionality? If no calls to the processPortlet function work, is there a specific thing in my Liferay configuration that I should look at to make it work?
Thank you in advance!
I don’t see any problem in your code, this should work. But you might have missed that you’re within a conditional expression:
If you’re testing this with anything other than IE6 or IE7, you won’t see the content of the conditional block