+

Search Tips   |   Advanced Search

Basic artifacts and their relation

The theme modularization framework foresees the following major artifacts and relations to one another.

The module framework provides the dynamic content spots...

  • co:config
  • co:head

The theme provides one or more profiles, which declare a set of modules. One of these profiles is used by each page to which the theme is applied. The default profile for the page is set using the theme metadata...

Page administrators can overwrite the default by setting the page metadata resourceaggregation.profile.

Available modules can be registered...

To aggregate contributions of type head, use the head spot...

    <link rel="dynamic-content" href="co:head"></link>

The head spot must be located inside the <head> element in the page markup. The <head> element must be placed before the <body> element in the page markup. The config spot must be located inside the <body> element in the page markup. Make the config spot the last element before the closing tag.

Contributions to the head extension point are best used for data loaded at the beginning of the page, including...

  • Markup that is only valid inside the <head> element
  • Core functions that must be available to other inline code within the page body

Because <link> elements can show only inside the head element, CSS must be added to the head contribution. Also, inline JavaScript that uses a utility function to attach an event handler, such as dojo.addOnLoad, depends on the function being defined earlier in the page markup.

Place the config spot at the end of the page body element. This allows the bulk of JavaScript resources to be written to the markup after the page layout and content area. The perceived responsiveness of the server increases by showing the page content while the browser is still downloading resources defined after the content area.

Note there is no guarantee the config spot is placed at the end of the page body element. It is valid for a theme designer to place the config spot inside the <head> element when it fulfills the first constraint.

Because the location of the config spot can vary, any code that displays inside the page content should not assume the config spot was already generated. The JavaScript code in the content area that depends on other JavaScript modules loaded by the config spot are deferred until the onload event is triggered which guarantees the code inside a portlet, for example, always works regardless of the position of the config spot. An example is portlet JavaScript that creates client-side widgets on page load. Widget modules themselves can be loaded by the config spot while the code that creates and uses them is executed onload.

Modules can declare dependencies on prerequisite modules. Additionally, they can declare their capabilities, which enable portlets and other code on the page to query the availability of a certain capability.


Parent The module framework