03-18-2020 12:20 PM
I am trying to add custom action in Aikau search result Page.
I am using sdk2 for testing.
Below thing I have tried.
Extension File :
<extension> <modules> <module> <id>Add custom action in search result page</id> <version>1.0</version> <auto-deploy>true</auto-deploy> <customizations> <customization> <targetPackageRoot>org.alfresco.share.pages.faceted-search </targetPackageRoot> <sourcePackageRoot>com.example.faceted-search</sourcePackageRoot> </customization> </customizations> </module> <module> <id>aikau-share - Example Aikau Widgets</id> <version>1.0</version> <auto-deploy>true</auto-deploy> <configurations> <config evaluator="string-compare" condition="WebFramework" replace="false"> <web-framework> <dojo-pages> <packages> <package name="search" location="js/search"/> </packages> </dojo-pages> </web-framework> </config> </configurations> </module> </modules> </extension>
faceted-search.get.js
var searchResultPage = widgetUtils.findObject(model.jsonModel.widgets, "id", "FCTSRCH_SEARCH_RESULT"); if(searchResultPage != null) { searchResultPage.config = { enableContextMenu : false, mergeActions : true, additionalDocumentAndFolderActions : ["example-action"] } } model.jsonModel.widgets.push({ name: "search/action" });
It is not adding custom action in Search result page.
Help Will be appreciated.
04-07-2020 06:07 AM
The code working but my mistake is I am providing different id in above code.
You need to provide same id which you have provided in share custom action.
ex
if(searchResultPage != null) { searchResultPage.config = { enableContextMenu : false, mergeActions : true, additionalDocumentAndFolderActions : ["example-action"] } }
Explore our Alfresco products with the links below. Use labels to filter content by product module.