forrest-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Thorsten Scherler <thors...@apache.org>
Subject Re: easily insert CSS for a single file?
Date Wed, 21 Mar 2007 22:14:38 GMT
On Wed, 2007-03-21 at 18:19 +0000, Stuart Yeates wrote:
> I'm playing with converting an HTML table into a CSS table (for better
> accessibility, comply with local guidelines, etc) and would like to
> know where to put the CSS to give it the narrowest scope possible
> (ideally a single file or class of files). 
> 
> I'm not keen to update the global CSS files because I'm aware that CSS
> can require a lot of platform- and browser-specific tweaking and I'd
> rather not break things for everyone. 
...

On Wed, 2007-03-21 at 18:48 +0000, Ross Gardler wrote:
> I can add a little info to Stuarts needs as he is a colleague (but I do 
> not know the answer). We are using the dispatcher, currently a 
> customised version of the pelt theme.

If you are using the dispatcher have a look at:
http://svn.apache.org/viewvc/forrest/trunk/whiteboard/plugins/org.apache.forrest.themes.core/themes/pelt.fv?view=markup
and
http://svn.apache.org/viewvc/forrest/trunk/whiteboard/plugins/org.apache.forrest.themes.core/themes/pelt/css/pelt-css.vt.xml?view=markup

The important part in short:
1) you need to define a url specific structurer:
<!-- CSS View of the request e.g. index.dispatcher.css -->
  <forrest:view type="css" hooksXpath="/">
    <!--Use/define css contracts in themes/yourPelt/css/ -->
  </forrest:view>
2) Activate the css link to the url specific css.
<!-- HTML View of the request (e.g. index.html)-->
  <forrest:view type="html" hooksXpath="/html/body">
    <forrest:contract name="branding-css-links">
      <!-- More information around this contract
        http://marc.theaimsgroup.com/?l=forrest-dev&m=113473237805195&w=2
        -->
      <forrest:property name="branding-css-links-input">
        <!-- You can request url specific css as defined above, 
          but beware that you need to use the *.dispatcher.css extension!!!-->
        <css prefix="" url="#{$getRequest}.dispatcher.css" media="screen" theme="Pelt"/>
      </forrest:property>
    </forrest:contract>
...
  </forrest:view>

This scenario will create to each html file a corresponding css file. e.g. requesting: index.html
will as well produce index.css.

I do not think this is what you want. 

Like I understand your mail you are looking for a file specific css (but only one). 

If you are testing your css you want to do only on one page, why not create an url specific
structurer.
e.g. ${project.resources}/structurer/url/index.fv. 

Did you see http://forrest.apache.org/pluginDocs/plugins_0_80/org.apache.forrest.plugin.internal.dispatcher/how/howto-dispatcher-structurer.html

salu2
-- 
Thorsten Scherler                                 thorsten.at.apache.org
Open Source Java & XML                consulting, training and solutions


Mime
View raw message