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

2 comments: