How do I bring the search box from "SHARE_HEADER" to right side of the "HEADER_TITLE_BAR". Please refer the below image.
Hi,
I would suggest you to create a share-extension module.
Follow these steps.
1. Create custom-header-extension.xml file at web-extension->site-data->extensions folder with the following content
<extension>
<modules>
<module>
<id>Custom Share Header Menu</id>
<version>1.0</version>
<customizations>
<customization>
<targetPackageRoot>org.alfresco.share.header</targetPackageRoot>
<sourcePackageRoot>admin-header</sourcePackageRoot>
</customization>
</customizations>
</module>
</modules>
</extension>
2. Create the admin-header folder inside site-webscripts
3. Create share-header.get.js inside admin-header with the following code
- This will remove search option from main menu
widgetUtils.deleteObjectFromArray(model.jsonModel, "id", "HEADER_SEARCH");
- and the following code will add it to title-bar.
var headerMenu = widgetUtils.findObject(model.jsonModel, "id", "HEADER_TITLE_BAR");
if (headerMenu != null) {
headerMenu.config.widgets.push({
id: "HEADER_SEARCH",
name: "alfresco/header/SearchBox",
align: "right",
config: {
id: "HEADER_SEARCH_BOX",
site: page.url.templateArgs.site,
siteName: "mySite",
enableContextLiveSearch: true,
linkToFacetedSearch: true,
sitePage: ""
}
});
}
Feel free to ask in case of any query.
Thanks
Kalpesh
Ask for and offer help to other Alfresco Content Services Users and members of the Alfresco team.
Related links:
By using this site, you are agreeing to allow us to collect and use cookies as outlined in Alfresco’s Cookie Statement and Terms of Use (and you have a legitimate interest in Alfresco and our products, authorizing us to contact you in such methods). If you are not ok with these terms, please do not use this website.