Component

September 18, 2005

A Component is a block of content plus a template - a “piece” of a website - such as an infobox, a footer or an image or just a piece of text.

Context:

  • Global - Can be re-used on any page
  • Page - A specific page or article
  • Simple - A simple data type

Categories:
Each Component can belong in 1 or more Component Categories so that a Container can specify what category of Components can be placed. Several Global Components could be of category “footer” so that only these would be allowed in a Global Container at the bottom of a page.

For example, all global components could be defined in 1 file called component/global.xml:

<components>
 <component id="1">
  <name>Header</name>
   <template>Header</template>
   <categories>
    <category>Default</category>
   </categories>
   <content>
    <text>My Website</text>
    <logo>MyLogo.gif</logo>
    <background>#FFDDCC</background>
   </content>
 </component>
.
.
.
</components>

Another alternative would be each component in a seperate XML file in the folder /component/global/ but this would make it difficult to reference I think. When all components are in 1 folder, a simple XPath expression will do:
/components/component[@id=1]/content

A further simplification could be that the template is optional. In this case the <content> element is passed through as XHTML.
<content><h1>My Heading</h1></content>

1 Comment »

  1. Bitflux calls their Global Components “Portlets

    Comment by Administrator — September 24, 2005 @ 8:14 pm

RSS feed for comments on this post.

Leave a comment