AnsweredAssumed Answered

Removing @region does not remove JS dependencies

Question asked by bulatyaminov on Dec 3, 2013
Latest reply on Dec 18, 2013 by bulatyaminov
I want to customize document library page by removing some components, for example tags selector on the sidebar. However if I try to do that via Share extension and a
<@region target="tags" action="remove"/>
, I get a JavaScript error in browser, coming from tag-filter.js:
<blockquote>Uncaught TypeError: Cannot set property 'innerHTML' of null tag-filter_cfe8eb842c90afad615db8da193e9ce1.js:213</blockquote>

So the JavaScript of tag-filter is still there on the page, while the HTML is removed.

Seems like when it comes to executing custom freemarker overrides, a tag-filter WebScript is already evaluated, and its JavaScript (and probably CSS) dependencies are already in the model. And @region removal does not exclude them.

Does anybody know of a way to get rid of such dependencies, either via .ftl or .js overrides?

(Steps to reproduce on Alfresco 4.2:
1. Create a Share extension
2. Create a file overriding templates/org/alfresco/documentlibrary.ftl:
<@region target="tags" action="remove"/>
3. Load the document library page. The tag filter is not there, but there is an error in browser console.)