Customizing the Share Header in Alfresco | Code Factory

Code Factory
2 min readDec 13, 2019

--

Reference Link : Link

File : share-header.get.js ( <Alfresco> -> tomcat -> webapps -> share -> WEB-INF -> classes -> alfresco -> site-webscripts -> org -> alfresco -> share -> header )

Removing Menu Items :

if (user.isAdmin)
{
widgetUtils.deleteObjectFromArray(model.jsonModel, 'id', 'HEADER_MY_FILES');
}

This code remove 'My Files' from the header if user is Admin.

Other widgets for removing menus from the header…

widgetUtils.deleteObjectFromArray(model.jsonModel, "id", "HEADER ADMIN CONSOLE");
widgetUtils.deleteObjectFromArray(model.jsonModel, "id", "HEADER_REPOSITORY");
widgetUtils.deleteObjectFromArray(model.jsonModel, "id", "HEADER_PEOPLE");
widgetUtils.deleteObjectFromArray(model.jsonModel, "id", "HEADER_TASKS");
widgetUtils.deleteObjectFromArray(model.jsonModel, "id", "HEADER_SITES_MENU");
widgetUtils.deleteObjectFromArray(model.jsonModel, "id", "HEADER SHARE FILES");
widgetUtils.deleteObjectFromArray(model.jsonModel, "id", "HEADER_HOME");

Before:

After:

Customizing the Sites Drop Down Menu :

// Find the 'Sites' menu
var sitesMenu = widgetUtils.findObject(model.jsonModel, 'id', 'HEADER_SITES_MENU');
if (sitesMenu != null)
{
// Hide the site finder
sitesMenu.config.showSiteFinder = false;
}

This code remove 'Site Finder' option from the 'Sites' menu.

Before:

After:

--

--

Responses (1)