[Templates] Views

Tony Bowden tony-tt@kasei.com
Fri, 29 Mar 2002 14:40:48 +0000


On Fri, Mar 29, 2002 at 01:50:08PM +0000, Mark Fowler wrote:
> > So, does the silence mean that _no-one_ gets VIEWs then? ;)
> No, just that I was very busy ;-)

*grin*

> The main thing I use views for is
>  a) Rendering Pod::POM  (Pod -> Templates)
>  b) Rendering XML.

*nod*.

I think I can grasp this sort of use, but where I'm still struggling is
in the concept of using views for "skinning"...

Let's take a fairly comming web example of a site with a header bar that 
looks different if you follow a link from some sort of affiliated site.

For simplicity's sake, let's say without views, I would have the
following sort of code:

[%
  BLOCK header_bar;
    PROCESS cookie == "friend" ? "friend_hb" : "normal_hb";
  END;

  BLOCK friend_hb;
    <div class="fheader">
     <h1>Welcome Visitors From Friends Site</h1>
     <img src="friend_welcome.gif">
    </div>
  END;
     

  BLOCK normal_hb;
    <div class="myheader">
     <h1>Welcome Visitors</h1>
     <img src="welcome.gif">
    </div>
  END;
%]

How would I make this use VIEWs instead?


Thanks,

Tony