You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@shale.apache.org by Bernhard Slominski <be...@zooplus.com> on 2007/02/26 12:14:43 UTC

Clay templating

Hi all,

I use Clay to build my pages with templates.

I have a base page, all my actual pages are derived from the base page.
My clay-config.xml looks like this

    <component jsfid="basePage" extends="clay">
        <attributes>
            <set name="clayJsfid" value="/templates/layout.html" />
        </attributes>
        <symbols>
            <set name="@title" value="Default Title" />
            <set name="@headercontent" value="/templates/header.html" />
            <set name="@bodycontent" value="space" />
            <set name="@footercontent" value="/templates/footer.html" />
        </symbols>
    </component>

    <component jsfid="startPage" extends="basePage">
        <symbols>
            <set name="@title" value="Application Home" />
            <set name="@bodycontent" value="/startBody.html" />
        </symbols>
    </component>

The "problem" is my actual page start.html it looks like this:

<span jsfid="startPage"/>

So the issue I'm having is that for every page I need two files
start.html
startBody.html

The start.html page only calls the "startPage" clay component.
So I'd like to have only one file which contains my body.
Are there any possibilties to do this?

Thanks

Bernhard

RE: Clay templating

Posted by Richard Eggert <re...@proteus-technologies.com>.
Let me see if I'm understanding you properly.  Do you also have a corresponding JSP page (start.jsp) to load the HTML template?  If so, it can contain an element like this:

<clay:clay jsfid="basePage">
   <clay:symbol name="title" value="Application Home" />
   <clay:symbol name="bodyContent" value="/startBody.html" />
</clay>

This is instead of doing <clay:clay jsfid="startPage" /> (i.e., startPage isn't strictly necessary).

Does this help?


Rich Eggert
Member of Technical Staff
Proteus Technologies, LLC
http://www.proteus-technologies.com



-----Original Message-----
From: Bernhard Slominski [mailto:bernhard.slominski@zooplus.com]
Sent: Mon 2/26/2007 6:14 AM
To: 'user@shale.apache.org'
Subject: Clay templating
 
Hi all,

I use Clay to build my pages with templates.

I have a base page, all my actual pages are derived from the base page.
My clay-config.xml looks like this

    <component jsfid="basePage" extends="clay">
        <attributes>
            <set name="clayJsfid" value="/templates/layout.html" />
        </attributes>
        <symbols>
            <set name="@title" value="Default Title" />
            <set name="@headercontent" value="/templates/header.html" />
            <set name="@bodycontent" value="space" />
            <set name="@footercontent" value="/templates/footer.html" />
        </symbols>
    </component>

    <component jsfid="startPage" extends="basePage">
        <symbols>
            <set name="@title" value="Application Home" />
            <set name="@bodycontent" value="/startBody.html" />
        </symbols>
    </component>

The "problem" is my actual page start.html it looks like this:

<span jsfid="startPage"/>

So the issue I'm having is that for every page I need two files
start.html
startBody.html

The start.html page only calls the "startPage" clay component.
So I'd like to have only one file which contains my body.
Are there any possibilties to do this?

Thanks

Bernhard