You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@forrest.apache.org by Thorsten Scherler <th...@apache.org> on 2005/07/27 19:47:41 UTC
Re: [Views] use twice a contract drive two include twice the
header...
On Wed, 2005-07-27 at 18:17 +0200, Cyriaque Dupoirieux wrote:
> Just a remark,
>
> When you use twice the same contract in a page, the *.js are include
> twice in the header.
Only the includes call or the whole head template?
> ( It also works with *.css includes :-) )
>
You mean if you use:
<forrest:css url="default.css"/>
<forrest:css url="default.css"/>
Hmm, we can prevent that, but do we have to and want to?
I will have a look tonight.
salu2
--
thorsten
"Together we stand, divided we fall!"
Hey you (Pink Floyd)
Re: [Views] use twice a contract drive two include twice
the header...
Posted by Thorsten Scherler <th...@apache.org>.
On Thu, 2005-07-28 at 10:13 +0200, Thorsten Scherler wrote:
> On Thu, 2005-07-28 at 09:40 +0200, Cyriaque Dupoirieux wrote:
> > Thorsten Scherler a écrit :
> >
> > >On Wed, 2005-07-27 at 19:47 +0200, Thorsten Scherler wrote:
> > >
> > >
> > >>On Wed, 2005-07-27 at 18:17 +0200, Cyriaque Dupoirieux wrote:
> > >>
> > >>
> > >>>Just a remark,
> > >>>
> > >>> When you use twice the same contract in a page, the *.js are include
> > >>>twice in the header.
> > >>>
> > >>>
> > >>Only the includes call or the whole head template?
> > >>
> > >>
> > >>
> > >
> > >The whole head template. it is fixed now.
> > >
> > >
> > >
> > >>> ( It also works with *.css includes :-) )
> > >>>
> > >>>
> > >>>
> > >>You mean if you use:
> > >><forrest:css url="default.css"/>
> > >><forrest:css url="default.css"/>
> > >>
> > >>Hmm, we can prevent that, but do we have to and want to?
> > >>
> > >>
> > >>
> > >
> > >I enabled this now as well even if IMO we should find a better way to
> > >prevent this issue from happening. One should not be able to include a
> > >forrest:css with the same @url in a view.
> > >
> > >
> > I was not talking about <forrest:css url="anyfile.css"/> included
> > several times in an *.fv - IMO this is the writer responsibility to be
> > carreful of what he includes in his view.
> > (We cannot control that the included css is necessary...)
> >
>
> I added a key which will include only
oops, I send to early.
...only once a css-stylesheet even if called multiple times.
salu2
--
thorsten
"Together we stand, divided we fall!"
Hey you (Pink Floyd)
Re: [Views] use twice a contract drive two include twice the header...
Posted by Cyriaque Dupoirieux <Cy...@pcotech.fr>.
Thorsten Scherler a écrit :
>On Thu, 2005-07-28 at 09:40 +0200, Cyriaque Dupoirieux wrote:
>
>
>>Thorsten Scherler a écrit :
>>
>>
>>>...
>>>
>>>
>>I was not talking about <forrest:css url="anyfile.css"/> included
>>several times in an *.fv - IMO this is the writer responsibility to be
>>carreful of what he includes in his view.
>>(We cannot control that the included css is necessary...)
>>
>>
>>
>
>I added a key which will include only
>
>
>
Good,
>>I was talking about the myContract-head content.
>>
>>In fact, I was trying to dispatch the content of a whole css used with pelt skin - screen.css - into several specific css included by the different contracts.
>>Benefits of this is that css :
>>
>> * are smaller and easy to understand
>> * contains only what the contract needs
>> * are only included if necessary, that is if you use the contract in
>> your view.
>>
>>Disadvantages are :
>>
>> * the number of included files in the HTML page increase. (but I
>> don't know if it can have an impact on performance.)
>>
>>Thank you for your correction, I will try this today.
>>
>>
>>
>
>Actually we started like this. Each contract could provide css-templates
>as well but we decided that we should rather not do it like this.
>
>The problem is the reusabilty of the contract in different skins. A
>contract should be as skin independent as possible. The performance
>should not be a problem.
>
>salu2
>
>
>
Well, quilckly, here is what I have done :
I have created :
* a *pelt *subfolder in resources/skin/css
* a *pelt *subfolder in resources/templates
I have modified the output.xmap to select the template called in your
view by searching in :
* first in your project,
* second, in resources/templates/{forrest:skin}
* third, in resources/templates
* finally, noFt.ft...
Then I have modified the resources.xmap to select the css a template
wants to include by searching in :
* first in your project resources,
* second, in resources/skin/css/{forrest:skin}
* third, in resources/skin/css
* finally, in the {forrest:context}/skins/common/css... (I don't
know if we should keep this option ?)
So, I don't think there is a problem with skin dependancy :
* If you use a standard template (I used several with pelt skin) you
can overide the standard css by putting a specific one in
resources/skin/css/{forrest:skin} - and even for customers, by
putting a super specific in project resources/css which will be
used in priority ... -
* If you use a specific template, you keep the standard css unless
you create a specific one in resources/skin/css/{forrest:skin} or
in project resources/css
In conclusion, it works well with me and I have several different
configuration depending on the need of the template I use...
Salutations,
Cyriaque,
Re: [Views] use twice a contract drive two include twice
the header...
Posted by Thorsten Scherler <th...@apache.org>.
On Thu, 2005-07-28 at 09:40 +0200, Cyriaque Dupoirieux wrote:
> Thorsten Scherler a écrit :
>
> >On Wed, 2005-07-27 at 19:47 +0200, Thorsten Scherler wrote:
> >
> >
> >>On Wed, 2005-07-27 at 18:17 +0200, Cyriaque Dupoirieux wrote:
> >>
> >>
> >>>Just a remark,
> >>>
> >>> When you use twice the same contract in a page, the *.js are include
> >>>twice in the header.
> >>>
> >>>
> >>Only the includes call or the whole head template?
> >>
> >>
> >>
> >
> >The whole head template. it is fixed now.
> >
> >
> >
> >>> ( It also works with *.css includes :-) )
> >>>
> >>>
> >>>
> >>You mean if you use:
> >><forrest:css url="default.css"/>
> >><forrest:css url="default.css"/>
> >>
> >>Hmm, we can prevent that, but do we have to and want to?
> >>
> >>
> >>
> >
> >I enabled this now as well even if IMO we should find a better way to
> >prevent this issue from happening. One should not be able to include a
> >forrest:css with the same @url in a view.
> >
> >
> I was not talking about <forrest:css url="anyfile.css"/> included
> several times in an *.fv - IMO this is the writer responsibility to be
> carreful of what he includes in his view.
> (We cannot control that the included css is necessary...)
>
I added a key which will include only
> I was talking about the myContract-head content.
>
> In fact, I was trying to dispatch the content of a whole css used with pelt skin - screen.css - into several specific css included by the different contracts.
> Benefits of this is that css :
>
> * are smaller and easy to understand
> * contains only what the contract needs
> * are only included if necessary, that is if you use the contract in
> your view.
>
> Disadvantages are :
>
> * the number of included files in the HTML page increase. (but I
> don't know if it can have an impact on performance.)
>
> Thank you for your correction, I will try this today.
>
Actually we started like this. Each contract could provide css-templates
as well but we decided that we should rather not do it like this.
The problem is the reusabilty of the contract in different skins. A
contract should be as skin independent as possible. The performance
should not be a problem.
salu2
> Salutations,
> Cyriaque,
>
>
> >svn log:
> >fixed the multiple include of head templates calls and as well the css
> >include. Now even if we use twice a contract that is requesting
> >{contract-name}-head it just get called once. The same is true for
> >forrest:css. If you use two times the same @url it still only get
> >includes once.
> >
> >Cheers for the report.
> >
> >salu2
> >
> >
> >
> >
> >>I will have a look tonight.
> >>
> >>salu2
> >>
> >>
--
thorsten
"Together we stand, divided we fall!"
Hey you (Pink Floyd)
Re: [Views] use twice a contract drive two include twice the header...
Posted by Cyriaque Dupoirieux <Cy...@pcotech.fr>.
Thorsten Scherler a écrit :
>On Wed, 2005-07-27 at 19:47 +0200, Thorsten Scherler wrote:
>
>
>>On Wed, 2005-07-27 at 18:17 +0200, Cyriaque Dupoirieux wrote:
>>
>>
>>>Just a remark,
>>>
>>> When you use twice the same contract in a page, the *.js are include
>>>twice in the header.
>>>
>>>
>>Only the includes call or the whole head template?
>>
>>
>>
>
>The whole head template. it is fixed now.
>
>
>
>>> ( It also works with *.css includes :-) )
>>>
>>>
>>>
>>You mean if you use:
>><forrest:css url="default.css"/>
>><forrest:css url="default.css"/>
>>
>>Hmm, we can prevent that, but do we have to and want to?
>>
>>
>>
>
>I enabled this now as well even if IMO we should find a better way to
>prevent this issue from happening. One should not be able to include a
>forrest:css with the same @url in a view.
>
>
I was not talking about <forrest:css url="anyfile.css"/> included
several times in an *.fv - IMO this is the writer responsibility to be
carreful of what he includes in his view.
(We cannot control that the included css is necessary...)
I was talking about the myContract-head content.
In fact, I was trying to dispatch the content of a whole css used with pelt skin - screen.css - into several specific css included by the different contracts.
Benefits of this is that css :
* are smaller and easy to understand
* contains only what the contract needs
* are only included if necessary, that is if you use the contract in
your view.
Disadvantages are :
* the number of included files in the HTML page increase. (but I
don't know if it can have an impact on performance.)
Thank you for your correction, I will try this today.
Salutations,
Cyriaque,
>svn log:
>fixed the multiple include of head templates calls and as well the css
>include. Now even if we use twice a contract that is requesting
>{contract-name}-head it just get called once. The same is true for
>forrest:css. If you use two times the same @url it still only get
>includes once.
>
>Cheers for the report.
>
>salu2
>
>
>
>
>>I will have a look tonight.
>>
>>salu2
>>
>>
Re: [Views] use twice a contract drive two include twice the
header...
Posted by Thorsten Scherler <th...@apache.org>.
On Wed, 2005-07-27 at 19:47 +0200, Thorsten Scherler wrote:
> On Wed, 2005-07-27 at 18:17 +0200, Cyriaque Dupoirieux wrote:
> > Just a remark,
> >
> > When you use twice the same contract in a page, the *.js are include
> > twice in the header.
>
> Only the includes call or the whole head template?
>
The whole head template. it is fixed now.
> > ( It also works with *.css includes :-) )
> >
>
> You mean if you use:
> <forrest:css url="default.css"/>
> <forrest:css url="default.css"/>
>
> Hmm, we can prevent that, but do we have to and want to?
>
I enabled this now as well even if IMO we should find a better way to
prevent this issue from happening. One should not be able to include a
forrest:css with the same @url in a view.
svn log:
fixed the multiple include of head templates calls and as well the css
include. Now even if we use twice a contract that is requesting
{contract-name}-head it just get called once. The same is true for
forrest:css. If you use two times the same @url it still only get
includes once.
Cheers for the report.
salu2
> I will have a look tonight.
>
> salu2
--
thorsten
"Together we stand, divided we fall!"
Hey you (Pink Floyd)