cancel
Showing results for 
Search instead for 
Did you mean: 

share-header.get.js extension override doesn't always work?

sscbrian
Champ on-the-rise
Champ on-the-rise
I built a small extension for share-header-get.jar that removes a list of widgets from the Share header menu.  It works everywhere *except* in the search results screen.  That screen shows the original header including the items that should be getting removed.  Is there a different javascript file that handles the search results pages or have I made some other kind of error?
8 REPLIES 8

afaust
Legendary Innovator
Legendary Innovator
Hello,

yes, the faceted search page is different from the majority of Share pages. It is built 100% on the new Aikau concept / framework of Alfresco. It basically is a page delivered by a single web script, the faceted-search.get. If you want to modify the Share header for that page, you need to apply a customization to that web script too.

Regards
Axel

ddraper
World-Class Innovator
World-Class Innovator
Simply add:


<alwaysApply>
   <webscript>share-header</webscript>
</alwaysApply>


…to your extension. See this example from our own customization for our Cloud offering:


<customization>
  <targetPackageRoot>org.alfresco.share.pages</targetPackageRoot>
  <sourcePackageRoot>org.alfresco.cloud.core.customizations.share.header</sourcePackageRoot>
  <alwaysApply>
    <webscript>share-header</webscript>
  </alwaysApply>
</customization>

sscbrian
Champ on-the-rise
Champ on-the-rise
Hmmm, hatt doesn't seem to do anything at all.  Script still works the same as it did without the alwaysApply option applied to it.  Header is modified on non-search pages, but the search pages are still coming up incorrect.

I've also tried modifying faceted search, but so far all I've managed to do there is completely break my Alfresco display.  🙂  Apparently it doesn't work the same way as the regular share header…

mwallach
Champ in-the-making
Champ in-the-making
AlwaysApply is not working as I would expect. In my case it is causing my meniuitem to appear twice in Share Header & not at all in faceted search results. I know it is somehow related to my js to add menuitem and the targetPackageRoot because if I use (alwaysApply &) org.alfresco.share.pages as targetPackageRoot, it appears in Faceted Search Results but not in Share Header. However if I use org.alfresco.share.header as targetPackageRoot it just appears twice in Share Header but not at all in Faceted Search Results

BTW, I was using as guidance: http://ohej.github.io/alfresco-tutorials/tutorial/aikau/tutorial.html#adding-a-menu-item-to-the-head...

grk
Champ in-the-making
Champ in-the-making
Any luck so far? I am having the same problem..

sscbrian
Champ on-the-rise
Champ on-the-rise
No luck so far with either suggestion given (as written, but they are both very informative and will likely lead to an eventual fix).  However, I was otherwise occupied for some time, I'm finally able to spend some time on this again.

sscbrian
Champ on-the-rise
Champ on-the-rise
I just couldn't get it done through a module.  I'm sure it *can* be done, but after hours of paging through Alfresco docs and not finding what I needed, I finally gave up and just hacked my code onto the end of the deployed faceted-search.get.js file.  And of course, I documented it on our upgrade process so it can be duplicated in the future as necessary when the hack gets overwritten by upgrades/WAR changes.

ddraper
World-Class Innovator
World-Class Innovator
This has been asked about again on one of my blog posts, so I've provided a sample… you can review the comment here: http://blogs.alfresco.com/wp/developer/2013/09/16/customizing-the-share-header-part-3/#comment-19366... which contains a link to the sample extension download.