AnsweredAssumed Answered

Template-scoped header errors in utilities.js

Question asked by cybertoast on Nov 13, 2009
Latest reply on Nov 19, 2009 by cybertoast
I'm trying to create site-scoped headers so that the header bar has different components based on which site you're on. But I'm starting with a simple common header for all sites, which would be different from the global header visible for other pages (user primarily).

I figured I could create  <@region id="header" scope="template"> and create a template for this header. I'm calling it collaboration-header in keeping with the documentlibrary components being called collaboration-*. This works well, but when I navigate to the documentlibrary I get nothing in the pane that displays the folders and files, the Library block has nothing in it, and the links in the Documents block all go nowhere.

I looked further into this and the error I'm getting is in utilities.js. Firebug console gives me:

this._events is undefined at utilities.js (line 37)

utilities.js is /share/yui/utilities/utilities.js

The steps I followed to create a template-scoped header (which I'm assuming to be what I need to do to have the header be localized to sites only):
  • Modify web-extension/templates/org/alfresco/documentlibrary.ftl to have <%region id="header" scope="template" protected=true />

  • Create web-extension/site-webscripts/org/alfresco/components/header/collaboration-header.get.[desc.xml, head.ftl, html.ftl, js] all copied from header.*

  • Modify collaboration-header.desc.xml's url to point to /components/header/collaboration-header

  • Leave collaboration-header.get.head.ftl the same as header.get.head.ftl, and collaboration-header.get.js the same as header.get.js

  • Customize collaboration-header.get.html.ftl as I need
I feel like I'm missing something that should be included (like a javascript file that ensures that this._events is not undefined) but I can't figure out what the global scoped header is doing that is different from the template-scoped collaboration-header.

Is my understanding of scope and customization incorrect? What am I doing wrong?

Outcomes