forrest-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Kevin <forr...@kegcl.demon.co.uk>
Subject Re: New user of views.
Date Thu, 08 Sep 2005 18:22:58 GMT
On Thu, 2005-09-08 at 01:25 +0200, Thorsten Scherler wrote:

...snip...

> > > > 2) Next I wanted to use my own css in that fv using <forrest:css>
so
> > > > in my xdocs/default.fv
> > > > 
> > > > <forrest:views xmlns:forrest="http://apache.org/forrest/templates/1.0"
>
> > > >     <forrest:view type="xhtml">
> > > >         <forrest:css url="default.css"/>
> > > >         <forrest:css url="nav-main-hook.css"/>
> > > > ...
> > > > 
> > > > (I had successfuly implemented my own nav-main contract implementation)
> > > > 
> > > > forrest site
> > > > 
> > > > Will produce *.html with stylesheets with different titled <link>
> > > > elements:
> > > > 
> > > > <link href="skin/default.css" title="default.css" rel="stylesheet"
> > > > type="text/css" />
> > > > <link href="skin/nav-main-hook.css" title="nav-main-hook.css" rel="stylesheet"
type="text/css" />
> > > > 
> > > > So my nav-main-hook.css won't cascade.
> > > 
> > > What do you mean?
> > 
> > #nav-main-hook defined in nav-main-hook.css should override
> > #nav-main-hook defined in default.css
> > 
> 
> Wait. css is working the way that what you define last it got matched.
> Like you have it in your example it *should* get override! Try
> commenting out default.fv. See what happens. I imagine you will see the
> css for your nav. If that is the case then just copy the parts you need
> of the default.css and create your own theme. That should work. ;-)

I've found another way to fix it:

<forrest:css url="default.css" media="screen" title="Custom"/>
<forrest:css url="nav-main-hook.css" media="screen" title="Custom"/>

Define "Custom" titles in default.fv

> > > >  I've used @title before with
> > > > alternative stylesheets. So to get it to work I removed the @title. Or
> > > > ensure they have the same name.
> > > 
> > > Actually I reckon that is a bug, I am not sure, that part is new. 
> > 
> > I think it is a bug. Though I can rewrite default.css and add my
> > nav-main-hook.css changes. Then put default.css in my skin/css as a
> > work around. Then remove <forrest:css url="nav-main-hook.css"/> from
> > the default.fv as it doesn't work.
> > 
> 
> Hmm, it should work, but I think it is a typical css behavior that you
> are running into. The thing on css is that if you want to override
> styles defined before you will need to reset them and define them
> again. 

Not had to do that before. But I'll try that if I have css override
problems.

> Best is to do what you describe. You can name it BTW like you want, it
> do not have to be called default.fv.
> 
> > > >  I noticed the new pelt view uses
> > > > alternative stylesheets (which will look good with some javascript to
> > > > switch between :) 
> > > 
> > > :) Yeah should be simple to write a contract for that. ;-)
> > > 
> > > > Though I haven't tried adding a <forrest:css> to
> > > > a fv and check what happens.
> > > 
> > > ¿? Your example above has forrest:css in the default.fv.
> > 
> > Yes but I didn't try it in the new pelt view.
> > 
> 
> Views are all the same. They only define structure and the theme (*.css)
> to use. BTW make sure the <forrest:css/> are direct children of
> <forrest:view/> otherwise it will not work!

Yes it is. Needed to rename default.fv to pelt.fv to see my view.

> > > > 
> > > > 3) How I see contracts at the moment are an override method of hooking
> > > > into leather-dev xslt. A well defined interface but to what resolution
> > > > can you go without knowing the internals? To explain what I mean, below
> > > > is the addition to my custom nav-main.ft. If I wanted to get to the <a>
> > > > element and define class="my-base-selected" it looks as if I'd have to
> > > > borrow more from the leather-dev skin to get calculate-tab-href?
> > > > 
> > > 
> > > The menu part is created from the book2menu.xsl of leather-dev, the tab
> > > part of tab2menu.xsl. We are in the middle of refactoring that as well.
> > > Anyway you will have to pick up what comes out of this transformation
> > > and apply your custom transformation to it.
> > > 

...snip...

> > <xsl:template match="li[not(@class)]">
> >  <xsl:apply-templates/>
> > </xsl:template>
> > 
> > leather-dev is before view to pass me <li> which I get rid of but
> > <xsl:apply-templates/> will transform the <a> back in a leather-dev
> > template somewhere.
> 
> No and yes. No, it applies all templates after that
> match="li[not(@class)]". Yes because applying all templates mean that
> you go back to the *.page. What you should try is <xsl:apply-templates
> select="*"/>

It will take me a long time to understand Tim's trip through view
pipelines and understand about *.page best stop while I'm ahead.

> >  Unless I try as above and would I have to use
> > tabutils to get calculate-tab-href? Or is $path resolved correctly.
> > 
> 
> Actually I have to look in the code for that. If you do not get an
> error, than yes it resolves correctly. ;-)
> 
> > > try localhost:8888/index.page
> > 
> > thanks for the tip
> > 
> 
> What do you get?

Well my browser didn't render the xml but a view source showed what
looked like a concat of

skinconf
info
nav-main content
views

> > > 
> > > > Thinking about it I'd just need to override class="base-selected" etc.
> > > > in css.
> > > > 
> > > > Well that was more than a toe in the water as I first thought :) Let me
> > > > know if there are any valid points to raise a jira [1 & 2] above.
3 is
> > > > just a workshop for me as a beginner in views and xsl too.
> > > > 
> > > 
> > > :)
> > > 
> > > Welcome to views.
> > 
> > Thanks I'll have a go at the leftbar nav menus next?
> > 
> 
> If you keen to use views and willing to help, than I would give you some
> "homework". The benefit is that you will help forrest, yourself and can
> have a custom menu that is partly independent of the site.xml.

Well I'll try, what had you in mind? Forrest is just an interest hobby
in my spare time in the evening to learn new skills, on a slow dial up
connection too :( 

> Have a look on the beautiful mail of Diwaker and the log of cheche from
> FT. I (tscherler or target{something}) talked with cheche what we have
> to do to enable that.

Sorry didn't understand that. Could you point me to the "homework" or an
outline here.  Diwaker's mail - I probably missed it and the log?

Kevin

> Still interested? ;-)

> salu2
> > Kevin
> > 
> > > salu2
> > 


Mime
View raw message