Customizing the Share Header in Alfresco | Code Factory


Donate : Link

Medium Blog : Link

Applications : 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:

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s