Template-scoped header errors in utilities.js

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-13-2009 09:16 AM
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:
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):
Is my understanding of scope and customization incorrect? What am I doing wrong?
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.jsThe 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
Is my understanding of scope and customization incorrect? What am I doing wrong?
Labels:
- Labels:
-
Archive
2 REPLIES 2

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-13-2009 09:36 AM
Forgot to add that I also modified web-extension/site-data/components/template.header.documentlibrary.xml:
<?xml version='1.0' encoding='UTF-8'?><component> <scope>template</scope> <region-id>header</regien-id> <source-id>documentlibrary</source-id> <url>/components/header/collaboration-header</url></component>

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-19-2009 12:41 PM
The problem turned out to be because I had removed the sites menu from the header, and the client-side code was blowing up when it tried to execute anything related to the *sites-menu element, which of course was missing!
The lesson here is to keep in mind that there is so much client-side link to the back-end that things will break if UI elements are changed in any way without looking in great detail at the events that are defined in the back-end. Freemarker (HTML), YUI and alfresco are tied very closely together, so always do things with great attention to detail!
The lesson here is to keep in mind that there is so much client-side link to the back-end that things will break if UI elements are changed in any way without looking in great detail at the events that are defined in the back-end. Freemarker (HTML), YUI and alfresco are tied very closely together, so always do things with great attention to detail!
