cancel
Showing results for 
Search instead for 
Did you mean: 

Alfresco ignore some webscripts or templates modifications

logxjb
Champ in-the-making
Champ in-the-making
Hello,

I'm using Alfresco community 4.2

I've created an AMP share module in Maven for customization and I edited several templates files, essentially commenting out/deleting some unwanted functionnalities to clean the user interface.

For some of the templates files, my modification are taken in account, for others they aren't.

Example of working modification in web-extension/site-webscripts/org/alfresco/footer/footer.get.html.ftl

I deleted the footer image with copyright and it effectively doesn't appear anymore on my Alfresco installation.

<blockcode>
<@markup id="html">
   <@uniqueIdDiv>
      <#assign fc=config.scoped["Edition"]["footer"]>
      <div class="footer ${fc.getChildValue("css-class")!"footer-com"}">
      </div>
   </@>
</@>
</blockcode>

Example of non-working modification in web-extension/site-webscripts/org/alfresco/navigation/collaboration-navigation.get.html.ftl

I have deleted the "Site dashboard" link and "Site member" link, but they still appear on any existing or new site I'm creating …

<blockcode>
<@markup id="html">
   <@uniqueIdDiv>
      <#assign activeSite = page.url.templateArgs.site!"">
      <#assign pageFamily = template.properties.pageFamily!"dashboard">
      <div class="site-navigation">
      <#if siteExists>
         <#if siteValid>
            <span class="navigation-separator"> </span>
            <#list pages as p>
               <#assign linkPage=p.pageUrl!p.title/>
               <#if linkPage?index_of(pageFamily) != -1>
                  <#assign linkClass>class="active-page theme-color-4"</#assign>     
               <#else>
                  <#assign linkClass>class="theme-color-4"</#assign>
               </#if>
            <span class="navigation-item"><a href="${url.context}/page/site/${activeSite}/${linkPage}" ${linkClass}>${(p.sitePageTitle!p.title)?html}</a></span>
               <#if p_has_next>
            <span class="navigation-gap"> </span>
               </#if>
            </#list>
         </#if>
         <span class="navigation-separator"> </span>
      </#if>
      </div>
   </@>
</@>
</blockcode>


Does someone here have an idea of what is going on ? I have the same problem when editing webscripts, but in them, my modifications are never taken in account …

I have checked into the exploded WAR on the server, all my files are effectively present into WEB-INF/classes/alfresco/web-extension/site-webscripts/org/alfresco/* folders.

Thanks,
Jérémy
4 REPLIES 4

afaust
Legendary Innovator
Legendary Innovator
Hello,

the collaboration-navigation web script is no longer used in Alfresco 4.2 as far as I know. It still exists, but all of its functionality has been moved to share-header, so the widgets can be customized much liked the global header.

Regards
Axel

logxjb
Champ in-the-making
Champ in-the-making
Hello,

Thank you for your answer, following you advice, I had a look at the share-header.get.js file which led me to share-header.lib.js under the share/imports directory.

I've edited the file like this in my AMP: https://gist.github.com/jberthet/92998abc1f1eed83d81f

I just commented push instructions for unwanted menu items (app menu and site menu).

Anyway, those modifications are totally ignored by Alfresco share after deploiement.

What am I doing wrong ?

Regards,
Jérémy

afaust
Legendary Innovator
Legendary Innovator
Hello,

you should not be editing share-header.lib.js directly.

First of all, if you deploy that to /web-extension/ it will not be picked up, because the share-header.get.js looks up the file using a specific path without the /web-extension/. As a general rule of thumb you can never override a .lib.js using /web-extension/ without overriding the relevant .get.js as well (changing the import path).

Second of all, you do not need to change that file. The best practice approach is to use a Share / Surf Customization to work on the widget model of the header. See the blog of Dave Draper, e.g. <a href="http://blogs.alfresco.com/wp/developer/2013/09/04/customizing-the-share-header-menu-part-1/">the first post of a three-part series on the new header</a> or <a href="http://blogs.alfresco.com/wp/developer/2013/11/25/webscript-javascript-controller-extensions-recap/">this recap of JavaScript controller extensions</a>.

Regards
Axel

logxjb
Champ in-the-making
Champ in-the-making
Hello,

Thanks for your help … extensions modules works far better than trying to replace existing files with my own version.

Problem solved.

Regards,
Jérémy