02-22-2019 03:30 AM
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.
02-22-2019 11:04 PM
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
02-22-2019 11:04 PM
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
02-25-2019 02:24 AM
Thanks Sanjay.
Riadh.
Explore our Alfresco products with the links below. Use labels to filter content by product module.