You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Varun Mehta <va...@persistent.co.in> on 2006/08/10 07:37:39 UTC

Multiple Template Handling

In a normal case scenario, we have a base template in which we plug-in the
other pages subsequently using the 

 

<span jwcid="$Border">

 .. blah blah blah

</span>

 

Now considering the case where there are different layout patterns, which
have different Border.html pages for initial layout of where the content
goes, how will we handle the scenario? 

 

Also considering the pet store example of using screen-definition [The
composite pattern to define various components of a jsp and join them in a
template], where I can call a single jsp in various 'templates'. How can I
implement such a feature using Tapestry?

 

I haven't dwelled into it much, but was thinking how simple is it to
implement such a thing?

 

Regards
Varun Mehta

Member of Technical Staff,
Persistent Systems Pvt. Ltd.,
Direct: +91 20 3023 4656
Board: +91 20 3023 4000 Ext: 4656
Visit PSPL at

*	 http://persistentsys.com <http://persistentsys.com/>    

 

*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
imagination is more important than knowledge - albert einstein 
*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*

 

Visit Varun at 

*	http://varun.cjb.net <http://varun.cjb.net/>   [HTML] 
*	http://varuninfo.cjb.net <http://varuninfo.cjb.net/>   [Blogged] 
*	http://varunmehta.cjb.net <http://varunmehta.cjb.net/>   [Flash] 

 

Persistent Systems -Software Development Partner for Competitive Advantage.
Persistent Systems provides custom software product development services.
With over 15 years, 140 customers, and 700+ release cycles experience, we
deliver unmatched value through high quality, faster time to market and
lower total costs.

 

 


DISCLAIMER
==========
This e-mail may contain privileged and confidential information which is the property of Persistent Systems Pvt. Ltd. It is intended only for the use of the individual or entity to which it is addressed. If you are not the intended recipient, you are not authorized to read, retain, copy, print, distribute or use this message. If you have received this communication in error, please notify the sender and delete all copies of this message. Persistent Systems Pvt. Ltd. does not accept any liability for virus infected mails.

Re: Multiple Template Handling

Posted by "hv @ Fashion Content" <in...@fashioncontent.com>.
> <span jwcid="$Border">
> .. blah blah blah
> </span>
>
> Now considering the case where there are different layout patterns, which
> have different Border.html pages for initial layout of where the content
> goes, how will we handle the scenario?

I assume you mean @Border not $Border

I don't like the using the @Border much as it tends to lock me into the 
exact same html on all pages, but given that choice here goes;
You would specify a parameter for your border component and have an @If in 
your @Border template to differentiate on the html generated.

If it is strict layout changing you can often get around it by switching css 
depending on needs and make the html less presentation oriented.

> Also considering the pet store example of using screen-definition [The
> composite pattern to define various components of a jsp and join them in a
> template], where I can call a single jsp in various 'templates'. How can I
> implement such a feature using Tapestry?

@Block or custom components.

I think you are thinking about a very common of general layout of your site. 
This is what my solution looks like:

<html jwcid="@DefaultingShell" title="Contact" 
defaults="ognl:identity.shellDefaults">

<head jwcid="$remove$">
<title>BlingOn Contact</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link rel="stylesheet" type="text/css" href="css/full.css"/>
</head>

<body jwcid="@Body" class="cream">
   <div id="backimg"> <img src="images/infopage-background.gif"/> </div>
  <div id="header">
    <div id="caption"> <img src="images/info-contact-title.gif"/>
      <p>We wish to engage in our world</p>
    </div>
  </div>
  <div id="outer">
 <div id="left">
   <div id="navigate">
            <div jwcid="@NavigationBar">
                 <a href="Home.html">HOME</a>
                 <a href="Help.html">HELP</a>
                 <a href="About.html">ABOUT</a>
                 <a href="Contact.html">CONTACT</a>
            </div>
         </div>
 </div>

  <div id="middle">
    <div id="content">
    <p>Do you have suggestions, ideas, comments, or do you just want to talk 
with
      us?</p>
    </div>
  </div>
 <div id="right"></div>
  </div>

  <div id="footer" jwcid="@Footer">copyright 2004, 2005<br/>Terms and 
conditions</div>
</body>
</html>

This allows me to vary the class tag on the body, and the contents of the 
header which would normally be part of the @Border component. The html of 
the page is pretty simple, so duplicating it on all page templates seems 
like a tiny tradeoff when getting the benefit of flexibility.
Another benefit I really like is that the static web design and the actual 
page templates are essentially the same, and you can instruct a competent 
web designer to include the extra tags.

Henrik 




---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org