alfrescoalfresco-shareaikau

alfresco search results : -> add parameter to search item url


I wanted to change the url of search result, I found that this is an aikau page , The faceted-search page returns multiple results , If we click on search result item which is document then it's redirects us to document-details page , enter image description here as shown in image the url /share/page/site/swsdp/document-details?nodeRef=workspace://SpacesStore/5fa74ad3-9b5b-461b-9df5-de407f1f4fe7 i wanted to add one parameter here

like this /share/page/site/swsdp/document-details?nodeRef=workspace://SpacesStore/5fa74ad3-9b5b-461b-9df5-de407f1f4fe7&searchTerm=web is there any way to add this parameter, please help. searchTerm=web


Solution

  • I have overrided aikau widget FCTSRCH_SEARCH_RESULT with my custom widget files by

    var searchResultWidget = widgetUtils.findObject(model.jsonModel.widgets, "id", "FCTSRCH_SEARCH_RESULT");
    
    if(searchResultWidget) {
        searchResultWidget.name = "custom/alfresco/search/AlfSearchResult";
    }
    

    So my widget FCTSRCH_SEARCH_RESULT will be like this

    {
                         id: "FCTSRCH_SEARCH_RESULT",
                         name: "custom/alfresco/search/AlfSearchResult",
                         config: {
                            enableContextMenu: false
                         }
                      }
    

    and able to call my custom widget js file and changed the url.