jcoder12
jcoder12

Reputation: 167

Search customization for html documents in Alfresco

I have a set of html documents. According to the normal search, whenever a document is searched for, a set of relevant documents shows up, by clicking on which we are taken to the document details page. From this document details, we can do view in Browser. My clients want this search results link to take them directly to the View in Browser page, skipping the document details page for html documents. How can I achieve this? I have a custom JavaScript which creates the html page. Can I modify the JS code, to produce this functionality?

Thanks in advance!

Upvotes: 0

Views: 270

Answers (1)

Andreas Steffan
Andreas Steffan

Reputation: 6159

Assuming you are running a recent version of Alfresco, there is a hack and an proper way.

The code you want to tweak is in share/components/search/search.js.

     renderCellDescription = function Search_renderCellDescription(elCell, oRecord, oColumn, oData)
     {
     // ...
        // displayname and link to details page                                                                                                                          
        var displayName = oRecord.getData("displayName");
        var desc = '<h3 class="itemname"><a href="' + url + '" class="theme-color-1">' + $html(displayName) + '</a>';

     // ...
     }

For the proper way, try following http://blogs.alfresco.com/wp/developer/2012/05/22/customizing-share-javascript-widget-instantiation-part-1/

If this looks all Chinese to you, hack the file in place an keep a copy of the original. Drop the tweaked version in tomcat/shared/classes/components/search.

If you are not running a recent version of Alfresco, go staight for the hack.

Upvotes: 1

Related Questions