forrest-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Thorsten Scherler <thors...@apache.org>
Subject Re: Help with new templates
Date Tue, 02 Aug 2005 09:47:51 GMT
Hi CFAS Webmaster,

first of all welcome to views. Second I have to repeat what Diwaker said
views is alpha and should better not used in production. 

Now to your questions:

On Mon, 2005-08-01 at 20:49 -0400, CFAS Webmaster wrote:
> Diwaker,
> 
>   It does to some degree.  I had found the foo.xml/foo.fv, default.fv 
> mapping and that helps immensely.  I think the part that I'm not 
> understanding is the other <forrest:hook> bit.
> 

You mean forrest:contract?
http://forrest.apache.org/docs_0_80/howto/howto-view-contracts.html

> Should that content be in another file and included somehow?  

no. What you are trying to do is *not* the best way to work with views.

You are using for http://www.cfas.org/
<meta name="Forrest-version" content="0.8-dev">
<meta name="Forrest-skin-name" content="tigris">

...but that is not the original tigris skin. You have added some
xsl-templates or custom content to it.

I imagine that you would like to keep the tigris style so actually what
you have to do is creating a tigris view and keeping your css. That way
you only need to refactor your custom site2xhtml.xsl and extract the
custom modification into a contract (see the views howto). We are doing
this for pelt as well right now but the code is not yet in our svn.

So instead of trying to include a file you have to create contracts.
There is a way to include different content but you should not use it.

The document() should not be used within a contract for the reason david
said. If you need more information about howto include custom content
for the contract then please keep on asking.

thx for using views.

salu2
thorsten


> I see, but 
> do not understand, how the leftbar is pieced together because forrest 
> generates it, specifically with the nav-section contract.  I just tried 
> hacking the sitemap-contact.ft contract, calling it extra-info.ft and 
> placing this into index.fv:
> 
>                 <forrest:hook name="content">
>                     <forrest:contract name="content-title"/>
>                     <forrest:contract name="content-abstract"/>
>                     <forrest:contract name="content-minitoc"/>
>                     <forrest:contract name="content-main"/>
>                 </forrest:hook>
>                 <forrest:hook name="rightbar">
>                     <forrest:contract name="extra-info"/>
>                 </forrest:hook>
> 
> The content bit comes from your default.fv and I've added the extra-info 
> piece.  The extra-info contract is a bit large and I don't know how much 
> stuff is normally posted to the list as far as code goes.  The core part 
> of the template goes like this:
> 
>         <xsl:stylesheet version="1.1"
>             xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
>             <xsl:template name="extra-info-body">
>               <xsl:if test="extra.xml">
>                 <xsl:for-each select="extra.xml">
>         <xsl:comment>+
>             |start extra-info
>             +</xsl:comment>
>                           <xsl:copy-of 
> select="div[@id='content']/div[@id='content-main']/*"/>
> <xsl:comment>+
>     |end content-main
>     +</xsl:comment>
> 
>                 </xsl:for-each>
>               </xsl:if>
>             </xsl:template>
>         </xsl:stylesheet>
> 
> Where extra.xml is where I've stuffed the information for the third 
> column.  Does this look like a valid approach where I just have some 
> syntax wrong, or have I completely missed what's supposed to be going on 
> here?
> 
> Thanks!
> -Paul
> 
> Diwaker Gupta wrote:
> 
> >On Sunday 31 July 2005 6:10 pm, CFAS Webmaster wrote:
> >  
> >
> >>  Is anyone would be willing to help me through the process of making
> >>this work properly?  The original site that I'm trying to emulate is:
> >>http://www.cfas.org/, the new site is http://cfas-new.kronenpj.dyndns.org/.
> >>    
> >>
> >
> >glad to help where I can :)
> >
> >  
> >
> >>  Essentially, I'd like the third column flush against the header.  I
> >>think it'll work if I can convince Forrest to place that column in its
> >>own <div id="rightbar">.  Unfortunately since it's part of the source
> >>file, it's part of <div id="content">.  I looked briefly at writing a
> >>new contract but I don't know enough about them to know if that's even a
> >>valid approach.
> >>    
> >>
> >
> >Have you read the documentation on views?
> >http://forrest.apache.org/docs_0_80/howto/howto-view-dsl.html
> >
> >IIUC, all you need to do is put some of the content (like your quicklinks and 
> >news items on the old site) within another <forrest:hook> in the view file

> >for the front page (most likely it should be named index.fv) and thats it!
> >
> >Just in case you didn't know, you can specify per file as well as per 
> >directory view configs. So, each page can have a different layout, all pages 
> >in the same directory can have a different layout and so on!
> >
> >The naming convention is that for a file named foo.xml, Forrest will look for 
> >foo.fv, and then default.fv in the directory containing foo.xml, and then the 
> >project wide default.fv and then finally the default.fv that ships with 
> >views.
> >
> >HTH,
> >Diwaker
> >  
> >
-- 
thorsten

"Together we stand, divided we fall!" 
Hey you (Pink Floyd)


Mime
View raw message