cancel
Showing results for 
Search instead for 
Did you mean: 

Replace documentlibrary template

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

I want to make small adjustements to the "documentlibrary.ftl" template file. I'm using an AMP to customize my Share installation.

For the moment, I was able to create a new template file, template instance file and page file, but I can't figure out how to tell Share that when the user access the documentlibrary, it should provide my template instead of the original one.

I've tried to put this into my share-config-custom.xml file, but it doesn't have any effect:


   <config evaluator="string-compare" condition="SitePages" replace="true">
      <pages>
         <page id="calendar">calendar</page>
         <page id="wiki-page">wiki-page?title=Main_Page</page>
         <page id="my-documentlibrary">documentlibrary</page>
         <page id="discussions-topiclist">discussions-topiclist</page>
         <page id="blog-postlist">blog-postlist</page>
         <page id="links">links</page>
         <page id="data-lists">data-lists</page>
      </pages>
   </config>


Thanks for any help or idea.

The final goal is to extend the default width of the documentlibrary resizer widget, like it is stated here: https://forums.alfresco.com/forum/end-user-discussions/alfresco-share/how-fix-navigation-tree-bar-wi...
3 REPLIES 3

niketapatel
Star Contributor
Star Contributor
Can you load your custom page by directly hitting it like - http://localhost:8080/share/page/my-documentlibrary

And try below configurations, Keep page id as documentlibrary


   <config evaluator="string-compare" condition="SitePages" replace="true">
      <pages>
         <page id="calendar">calendar</page>
         <page id="wiki-page">wiki-page?title=Main_Page</page>
         <page id="documentlibrary">my-documentlibrary</page>
         <page id="discussions-topiclist">discussions-topiclist</page>
         <page id="blog-postlist">blog-postlist</page>
         <page id="links">links</page>
         <page id="data-lists">data-lists</page>
      </pages>
   </config>   

ddraper
World-Class Innovator
World-Class Innovator
One word of caution on this… I have observed that not all links to the Document Library honour the setting in the configuration (i.e. some are hard-coded), this is something that does need to be fixed.

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

Thank you for your 2 answers.

Going to http://localhost:8080/share/page/my-documentlibrary was loading my customized template page, but nothing was shown in the filters and content zone …

Anyway, by inspecting the source code of the page rendered when accessing the standard document library, I discovered that this wasn't the documentlibrary.ftl used. The code for calling the Resizer widget didn't include the setOptions call expected in that template. It was a pure standard instantiation of the widget. So, I ended up with a totally different solution.

For another functionnality, I was already overloading the tree.js client file. Since the widget was later instantiated without any customization, I just overloaded the prototype of the Resizer widget inside my custom tree.js.

Alfresco.widget.Resizer.prototype.options.initialWidth = 210;


Not the most clean solution, but it is working anyway.