The search page in Alfresco Share is one of the few full Aikau pages in the application. The majority of the pages in Share were written before Aikau was created and are comprised of multiple Surf Components - of which the header has been rendered by Aikau since version 4.2.
The search page was updated in 5.0 to be a full Aikau page and does not use the same Surf Component to render the header.
This means that the standard header customization will only be targeting the Surf Component WebScript and not the full page WebScript.
To get this to work you need to take advantage of the alwaysApply
element in the module configuration.
So for example a typical extension module to target the header might look like this:
<extension>
<modules>
<module>
<id>Extension Module</id>
<auto-deploy>true</auto-deploy>
<evaluator type="default.extensibility.evaluator"/>
<customizations>
<customization>
<targetPackageRoot>org.alfresco</targetPackageRoot>
<sourcePackageRoot>org.alfresco.share.pages.customizations</sourcePackageRoot>
</customization>
</customizations>
</evaluator>
</module>
</modules>
</extension>
This would be targeting all WebScripts in the org.alfresco
package and would look for matching files in the org.alfresco.share.pages.customizations
package.
So the Share header is defined by the share-header.get.js WebScript, and if your extension file should be in org.alfresco.share.pages.customizations.share-header.get.js
.
However, the org.alfresco.share-header.get.js
WebScript is not used on the search page, which is why the customization will not take effect.
Instead, you should include an additional customization
block to ensure your extension is applied, it should look similar to this:
<customization>
<targetPackageRoot>org.alfresco.share.pages</targetPackageRoot>
<sourcePackageRoot>org.alfresco.share.pages.customizations.share.header</sourcePackageRoot>
<alwaysApply>
<webscript>share-header</webscript>
</alwaysApply>
</customization>
This says that for all WebScripts in the org.alfresco.share.pages
package (which is where all full Aikau pages are defined). You should always apply extension files called "share-header" (so .get.js, .get.html.ftl and .get.properties files would also be matched).
Note that the sourcePackageRoot
is defines exactly where the extension file should be found.