forrest-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Thorsten Scherler <thors...@apache.org>
Subject Re: Link to CSS howto-structurer-dsl.html
Date Fri, 16 Dec 2005 11:25:49 GMT
El vie, 16-12-2005 a las 10:50 +0100, Cyriaque Dupoirieux escribió:
> Ross Gardler a écrit :
> 
> > Paul Bolger wrote:
> >
> >> Can anyone explain how to link to an external CSS file from an .fv file?
> >
> >
> > http://marc.theaimsgroup.com/?l=forrest-dev&m=113244185027121&w=2
> >
> Hi, Paul,
> 
>     To summarise :
> 
>     * The tag to include css file has the following syntax :
> 
> <forrest:css url="layout.screen.css" media="screen|print" theme="themeName"/>
> 
>     * url attribute indicates the name of the css file, the dispatcher
>       searches for this file in the following order :
>           o Does the css file exists in the following directory - if
>             yes, use this one :
> 
> $PROJECT_HOME/src/documentation/resources/themes/yourtheme/css/layout.screen.css
> 
>           o Else, does the css file exists in the following directory -
>             if yes, use this one :
> 
>         $FORREST_HOME/whiteboard/plugins/org.apache.forrest.plugin.output.themer/resources/themes/yourtheme/css/layout.screen.css
> 
>           o Else, does the css file exists in the following directory -
>             if yes, use this one :
> 
>         $FORREST_HOME/whiteboard/plugins/org.apache.forrest.plugin.output.themer/resources/themes/common/css/layout.screen.css
> 
>     * media attribute indicates to the browser the stylesheets to use
>       depending on the detination media :
>           o screen : the stylesheet is used with the browser displaying
>             the page on the screen,
>           o print - the stylesheet is used while printing the document -
>             or print preview...
> 
>         (There is a bug with firefox, the bug is already declared twice
>         in bugzilla, so we are waiting...)
> 
>     * theme attribute indicates to the browser for which theme this
>       stylesheet should be used, letting you add several css files
>       corresponding to different themes of the same page.
> 
> 
> HTH,
> 
> Cyriaque,
> 

:)

Very nice, Cyriaque.

I want to add the newest changes for the dispatcher transformer.

We dropped the <forrest:css/> element because is was to much html
specific. We decided to use a contract for the same functionality (I
just checked it in):

<forrest:contract name="branding-css-links">
 <forrest:property name="branding-css-links-input">
  <css url="common.css"/>
 </forrest:property>
</forrest:contract>

It is working like described from Cyriaque because I used the same code
on which he is basing his description. The only difference is like you
see from the sample that I had to drop the forrest: namespace. 

BTW IMO we have to rethink the default url prefixing/rewriting!
Since css support is based now on contracts they can be as well
requested with *.fv files (like I have shown in the xhtml2 & dispatcher
thread). 

...but since we rewrite e.g.
<forrest:css url="common.css"/>
to 
<link href="../themes/common.css" rel="stylesheet" title="common.css"
type="text/css" />
it is not possible to refer to a css fv that may resist in the same root
like the request.

e.g. the index-foo.fv has a type="css" meaning there is a match for
index-foo.css, but we would not be able to match this since we rewrite
it to "../themes/index-foo.fv". IMO we need an attribute to prevent this
rewriting. like:

<forrest:contract name="branding-css-links">
 <forrest:property name="branding-css-links-input">
  <css url="index-foo.css" rewrite="false"/>
 </forrest:property>
</forrest:contract>

Which will have to be outputted like:
<link href="index-foo.css" rel="stylesheet" title="common.css"
type="text/css" />

After "forrest site" you would find
root
|--index-foo.html
`--index-foo.css

wdyt?

salu2
-- 
thorsten

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


Mime
View raw message