Monday 4 November 2013

Some helpful portal.properties

Hi All,

 Some times you want to achieve something,and you spent lot of time in finding its solution.

 There are some things that can be easily achievable if you have better knowledge of portal.properties.

  One such property is : 'layout.show.portlet.access.denied'

    # Set this to true if users are shown that they do not have access to a
    # portlet. The portlet init parameter "show-portlet-access-denied" will
    # override this setting.
    #
    layout.show.portlet.access.denied=true

When user don't have roles to access particular portlet,it shows error message. So If you want to completely hide portlet from user you can set this property to "false" in portal-ext.properties.


Regards,
Dhrutika

Sunday 3 November 2013

Links to Add Application, Toggle Edit Controls , Contol Panel from Liferay Custom Theme in 6.1

Hi All,

Sometime if you are creating your custom theme, you may not want whole Liferay dockbar and just require some of the links like Add Application, Toggle Edit Controls and Control Panel.

I have done same kind of development in one of my projects. That could be helpful to you.

This customization was done Liferay 6.1 EE GA2.

 #if ($permissionChecker.isOmniadmin() || $permissionChecker.isGroupAdmin($group_id))
         <li><a href="$htmlUtil.escape($theme_display.getURLControlPanel())">$languageUtil.get($locale,  "control-panel")</a></li>                                                           
  #end                                               
  #if ($permissionChecker.isOmniadmin() || $permissionChecker.isGroupAdmin($group_id))
         <li><a onclick="Liferay.LayoutConfiguration.toggle('87');" href="javascript:void(0);">   $languageUtil.get($locale, "add-application")</a></li>

#end
#if ($permissionChecker.isOmniadmin() || $permissionChecker.isGroupAdmin($group_id))
     <li class="toggle-controls"><a href="javascript:void(0);">$languageUtil.get($locale, "edit-controls")</a></li>

#end

For toggle edit you would need below script to be added in your vm file.

 
#if ($is_signed_in)
<script type="text/javascript">
//For toggle edit controls load script once on page
AUI().use('node',function(A) {
  Liferay.Util.toggleControls();
 });
</script>
#end


Regards,
Dhrutika Vyas