Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Liferay 6 create 'Add Page' link outside of dockbar

Is it possible to replicate the 'add page' link outside of the dockbar?

It is possible to replicate the 'add application', 'control panel', 'toggle controls' and 'page layout' links outside of the dockbar by adding javascript to main.js.

This question hasn't been answered on the Liferay forums as yet so I thought I'd try here.

like image 253
Gem E Avatar asked Nov 14 '22 14:11

Gem E


1 Answers

The following are for Liferay 6.1 (earlier versions my differ but it's a starting point):

  1. Control Panel

    You can use the following URL:

    http://yourliferaysite.com/group/control_panel?doAsGroupId={groupId}&refererPlid={plid}

    Where you replace {groupId} with the Group ID of the community you're currently accessing, and replace {plid} with the plid of the page (layout) that you're currently on. Note that the plid is NOT the Layout Id and can be found in the database in the layout table.

  2. Edit Controls / Toggle Controls

    You need to add and remove the following CSS classes from the <body> tag.

    The classes are

    • controls-hidden : This CSS class hides the controls
    • controls-visble : This CSS class shows the controls

    These can both be added and removed easily using jQuery's addClass and removeClass methods.

    $('body').removeClass('controls-visible').addClass('controls-hidden');
    

    This will hide the controls, and the vice versa will show the controls.

    or using Alloy UI:

    AUI().use('node', function(A) {
        A.one('body').replaceClass('controls-visible','controls-hidden');
    }
    
  3. Add Page

    I'm afraid this I also don't know how to do. It must be buried somewhere in the Alloy UI libraries but I can't debug how it works! Sorry!

Hopefully the first two will prove useful!

like image 131
Jonny Avatar answered Nov 16 '22 04:11

Jonny