Customize the share

cancel
Showing results for 
Search instead for 
Did you mean: 
riadhazzouz
Active Member

Customize the share

Jump to solution

How can i add an element in header bar next to the repository ?
are there any tutorials that explain these kind of customizations.
I tried this one https://community.alfresco.com/community/ecm/blog/2013/09/04/customizing-the-share-header-menu-part-... , but I think I am missing other stuff.

1 Solution

Accepted Solutions
sanjaybandhniya
Intermediate

Re: Customize the share

Jump to solution

Hi,

Alfresco header bar is developed with aikau way.

You can add new menu to header bar using extension module.

1)Create *.xml file at below path and add code.

share\src\main\amp\config\alfresco\web-extension\site-data\extensions\xxx.xml.

<extension>
<modules>
<module>
<id>Add custom menu item to header</id>
<version>1.0</version>
<auto-deploy>true</auto-deploy>
<customizations>
<customization>
<targetPackageRoot>org.alfresco.share.header</targetPackageRoot>
<sourcePackageRoot>com.example.header</sourcePackageRoot>
</customization>
</customizations>
</module>
</modules>
</extension>

2)Create share-header.get.js file at below path and add code.

share\src\main\amp\config\alfresco\web-extension\site-webscripts\com\example\header\share-header.get.js

var headerMenu = widgetUtils.findObject(model.jsonModel, "id", "HEADER_APP_MENU_BAR");
if (headerMenu != null) {
headerMenu.config.widgets.push({
id: "HEADER_CUSTOM_PROFILE_LINK",
name: "alfresco/menus/AlfMenuBarItem",
config: {
label: "My Tasks",
targetUrl: "/my-tasks" //Here you can add your page url.
}
});
}

Thanks,

Sanjay

View solution in original post

2 Replies
sanjaybandhniya
Intermediate

Re: Customize the share

Jump to solution

Hi,

Alfresco header bar is developed with aikau way.

You can add new menu to header bar using extension module.

1)Create *.xml file at below path and add code.

share\src\main\amp\config\alfresco\web-extension\site-data\extensions\xxx.xml.

<extension>
<modules>
<module>
<id>Add custom menu item to header</id>
<version>1.0</version>
<auto-deploy>true</auto-deploy>
<customizations>
<customization>
<targetPackageRoot>org.alfresco.share.header</targetPackageRoot>
<sourcePackageRoot>com.example.header</sourcePackageRoot>
</customization>
</customizations>
</module>
</modules>
</extension>

2)Create share-header.get.js file at below path and add code.

share\src\main\amp\config\alfresco\web-extension\site-webscripts\com\example\header\share-header.get.js

var headerMenu = widgetUtils.findObject(model.jsonModel, "id", "HEADER_APP_MENU_BAR");
if (headerMenu != null) {
headerMenu.config.widgets.push({
id: "HEADER_CUSTOM_PROFILE_LINK",
name: "alfresco/menus/AlfMenuBarItem",
config: {
label: "My Tasks",
targetUrl: "/my-tasks" //Here you can add your page url.
}
});
}

Thanks,

Sanjay

riadhazzouz
Active Member

Re: Customize the share

Jump to solution

Thanks Sanjay.
Riadh.