cancel
Showing results for 
Search instead for 
Did you mean: 

Add new link to site navigation bar

qingl97
Champ in-the-making
Champ in-the-making
Hi,

I am quite confused about why my customizations to share-header.get.js doesn't work.

I am developping a module in Eclipse with Alfresco SDK 2.0 for Alfresco One 5, running on Windows.

Here is the file associated:

<li>
/config/alfresco/web-extension/site-data/extensions/myextension.xml
</li>
the configuration within it :

<extension>
   <modules>
      <module>
         <id>myextension</id>
         <version>1.0</version>
         <auto-deploy>true</auto-deploy>
         <!– Do customizaitons to webscripts –>
         <customizations>
            <customizaiton>
               <!– To add a page link in site navigation bar –>
               <targetPackageRoot>org.alfresco.share.header</targetPackageRoot>
               <sourcePackageRoot>com.example.share.header</sourcePackageRoot>
            </customizaiton>
         </customizations>
      </module>
   </modules>
</extension>


<li>
/config/alfresco/web-extension/site-webscripts/com/example/share/header/share-header.get.js
</li>
the code within it :


var siteNavigationWidgets = widgetUtils.findObject(model.jsonModel, "id", "HEADER_NAVIGATION_MENU_BAR");

if(siteNavigationWidgets != null) {
   siteNavigationWidgets.config.widgets.push({
      id: "HEADER-SITE-LOCALGROUPS",
      name: "alfresco/menus/AlfMenuBarItem",
      config: {
         id: "HEADER-SITE-LOCALGROUPS",
         label: msg.get("page.siteLocalGroups.title"),
         targetUrl: "site/" + page.url.templateArgs.site + "/site-localgroups",
         selected: (page.titleId == "page.siteLocalGroups.title")
      }
   });
}


The targetUrl is pointing to a new site page that I already created and tested. It can be accessed well.

The problem is when I deployed the module(restart Share and the module is auto-deployed), the expected link didn't display in the site navigation bar. I don't why.

Then I tried the tutorials found here:

<a>http://blogs.alfresco.com/wp/developer/2013/09/04/customizing-the-share-header-menu-part-1/</a>

I did exactly the same thing indicated in that tutorial, only except that I was testing in Eclipse with a Share archetype for AMP, not for JAR as used in that tutorial. But I was suprised to find that I even cound't get the result showed in the tutorial.

Both my trials failed. Any one have any ideas about it?
2 REPLIES 2

hardik1512
Star Contributor
Star Contributor
You have spelling mistake in customization tag. I think that may be the issue.

qingl97
Champ in-the-making
Champ in-the-making
Ah yes!! I tried again after correcting the spelling and it worked!

I was too careless.

Thanks man.