2016-02-29 36 views
0

我想定製Alfresco aikau頁腳。一開始我想在AlfShareFooter中注入自定義的html模板。到目前爲止,我創建了一個擴展:Alfresco定製aikau頁腳

<extension> 
    <modules> 
    <module> 
     <id>MyCmpny widgets</id> 
     <version>1.0</version> 
     <auto-deploy>true</auto-deploy> 
     <configurations> 
     <config evaluator="string-compare" condition="WebFramework" replace="false"> 
      <web-framework> 
      <dojo-pages> 
       <packages> 
       <package name="mycmpny" location="js/mycmpny"/> 
       </packages> 
      </dojo-pages> 
      </web-framework> 
     </config> 
     </configurations> 
    </module> 
    </modules> 
</extension> 

HTML模板頁腳,現在我試圖重寫AlfShareFooter對象的templateString

define(["dojo/_base/declare", 
     "alfresco/footer/AlfShareFooter'", 
     "dojo/text!./templates/ep-footer.html"], 
     function (declare, AlfShareFooter, template) { 
     return declare([AlfShareFooter], { 
      templateString: template 
     }) 
     }); 

但它不工作。我不熟悉的道場,我認爲這個問題是在語法...

回答

2

我已經找到了如何覆蓋模板:

define(["dojo/_base/declare", 
    "dojo/text!./templates/my-footer.html", 
    "alfresco/footer/AlfShareFooter"], 
    function (declare, template, AlfShareFooter) { 
     return declare([AlfShareFooter],{ 
     postMixInProperties: function my_footer_AlfShareFooter__postMixInProperties(){ 
      this.inherited(arguments); 
      this.templateString = template; 
     } 
     }); 
    }); 

不重大但按自定義頁腳模板意味着巨大的自定義CSS和i18n ...所以我寫了一篇post關於改變Alfresco的Aikau頁腳。

+1

當您嘗試訪問您的帖子時,目前有404錯誤。如果你可以提供它,閱讀會很有趣。 –

+0

糟糕,評論更新) – streetturtle

+0

感謝您更新鏈接 - 這是一個非常好的例子。 –