logo       

Re: Adding a header and footer at runtime: msg#00016

java.enhydra.xmlc

Subject: Re: Adding a header and footer at runtime

importNode() is probably your answer...

In my Enhydra XMLC book (page 276) I talk about a strategy that
leverages the J2EE Composite View pattern... you create a page that
represents the basic layout of your overall page (typically a collection
of tables), then you use importNode to extract subDOMs from other pages
(one for the ad header, one for the footer, one for the main page, one
for the side menu, and so on). By reaching into each contributing page
with importNode(), you're leaving the unneeded <HTML>, <BODY>, etc.,
tags behind.

Suppose your design person has built an ad with Dreamweaver. Put an ID
in the table element that contains the ad and make a copy of the table
with importNode and use appendChild() to put it into the table
responsible for containing the ad at the top of main page.

I created a graphic that shows how this works. It was the trickiest
graphic I had to construct, so be sure have take a look.

David

Ben Sinclair wrote:
I want to add a header and footer to my HTML classes at runtime, for branding purposes. It's not feasible to compile new classes each time I want to create a new set of branded pages, especially since users are going to be doing this anyway.

Currently the best I've done is add some span tags to my HTML that I replace at runtime with a custom header and footer pulled from some files. This produces bad HTML because XMLC automatically adds <HTML>, <HEAD>, etc. tags if they don't exist when compiling.

Does anyone have a better suggestion?



--
Ben Sinclair
ben@xxxxxxxxxxxxxxx
_______________________________________________
XMLC mailing list
XMLC@xxxxxxxxxxx
http://www.enhydra.org/mailman/listinfo.cgi/xmlc



<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | FAQ | advertise