forrest-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From CFAS Webmaster <webmas...@cfas.org>
Subject Re: Help with new templates
Date Tue, 02 Aug 2005 02:04:07 GMT
Diwaker,

  In responding to my own post, I've made some progress.  I've found the 
correct xsl syntax to import a file and used that in the contract, 
adjusting for the location of where forrest thinks it wants the file vs. 
where it actually lives:

            <xsl:template name="extra-info-body">
              <xsl:for-each 
select="document('../../../cfas-new/src/documentation/content/xdocs/extra.xml')">

        <xsl:comment>+
            |start extra-info
            +</xsl:comment>
               <xsl:copy-of select="document/*"/>
        <xsl:comment>+
            |end extra-info
            +</xsl:comment>

              </xsl:for-each>
            </xsl:template>

Firefox is telling me that <div id='rightbar'> is still within <div 
id='content'> but the HTML says otherwise.   Unfortunately I'm still 
having a problem with the CSS, or at least I think it's the CSS. I have 
#rightbar declared as this:

#rightbar {
    float: right;
    width: 100px;
    background: #eae8e3;
    border: thin dashed #565248;
    margin-bottom: 10px;
}

And I see the decorations correctly, as is the width and the float, but 
Firefox is refusing to place it up by the header, instead stuffing it 
below almost everything else.

Any thoughts?
-Paul

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.
>
> Should that content be in another file and included somehow?  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
>>  
>>

Mime
View raw message