Fabian,

Sorry for the name exchange, they look so alike I didn't notice.

I think my case is not so rare, components often render a block
somewhere
in a page with their own looks, thus their own styles. Sometimes they
also require their own javascripts. In my case the stylesheets/
javascripts
included sometimes also depend on the context, e.g. what module the
page
around it is in. These are dependencies of the component one does not
want to repeat for every layoutor module that uses the component!
Luckily the sfCommonFilter inserted all javascripts and stylesheets
implicitely after rendering the whole page, which imho was a great
benefit
especially from oop perspective!

For now I copied a version of sfCommonFilter.class.php and re-added
it to my filters.yml, so everything works ok, but I hope you and the
other team members can give it a thought for the future?: are
component
slots that powerful when they cannot maintain all their dependencies
like js/css themselves?

Thanks again, kind regards,

Dennis



On 3 jun, 15:19, Fabian Lange <fabian.la...@symfony-project.com>
wrote:
> Hi Dennis,
> i am Fabian, not Fabien.
> Now I understand your issue. The point is that there will be always a layer
> where it is too late.
> basically all used javascripts and stylesheets must be known before the
> layout is rendered. Rendering the layout should not have effects on anything
> else.
> Your component slots try to add something for which it is too late already.
> Are the components slots that highly dynamic that you need to decide in the
> template of that component which css needs to be inserted?
> what you are calling for would be basically the option two add an extra
> layer. say a global template + a global layout decoration
> I am not sure if that is support now (i dont think so) or if we want to add
> it.
> Perhaps your case is too rare to add it. Sounds like you should do this in
> your own filter then (a copy of sfCommonFilter).
>
> I wonder how much this is a backwards incompatible change.
>
> Fabian
>
> On Wed, Jun 3, 2009 at 3:10 PM, Dennis Verspuij
> <dennis.versp...@gmail.com>wrote:
>
>
>
>
>
> > Hi Fabien
>
> > Thanks for your prompt reply.
>
> > The problem is that the common filter inserted the link and script
> > tags áfter generating
> > the whole layout body, so when I use use_javascript and/or
> > use_stylesheet in the
> > template of a component I include by using include_component_slot() in
> > the body
> > of a layout these get included as well.
>
> > With explicit calls to include_stylesheets() and include_javascripts()
> > in
> > the layout head tag the use_stylesheet() and use_javascript() calls
> > in component slottemplates are "too late"!
>
> > The problem exists in prior sf versions as well if you use explicit
> > include_stylesheets() and include_javascripts() calls, that's why I
> > let sfCommonFilter do it implicitely. Since [17794] explicit is now
> > forced.
>
> > Hope you understand it now, let me know.
>
> > Dennis
>
> > On 3 jun, 14:53, Fabian Lange <fabian.la...@symfony-project.com>
> > wrote:
> > > Hi Dennis,
> > > You can just include include_stylesheets() and include_javascripts()
> > calls
> > > where you want the stuff to go to. if you want to have exactly the same
> > > behaviour as before, just put them before the end of the head tag.
>
> > > I dont understand why you think the common filter did something differen.
> > > can you elaborate?
> > > Fabian
>
> > > On Wed, Jun 3, 2009 at 2:28 PM, Dennis Verspuij
> > > <dennis.versp...@gmail.com>wrote:
>
> > > > Hello,
>
> > > > The only way to succesfully add stylesheets and javascripts using the
> > > > use_stylesheet() and use_javascript() helpers from component slots
> > > > templates was to let the sfCommonFilter add all stylesheets and
> > > > javascripts implicitely after rendering a page (thus not including
> > > > include_stylesheets() and include_javascripts() calls in a layout
> > > > template html head tag).
>
> > > > Since the removal of sfCommonFilter in Sf 1.3 changeset [17794] this
> > > > now is impossible to do. Any ideas to keep this powerful possibility,
> > > > thus preventing me from including all stylesheets and javascripts of
> > > > any component that could be possibly loaded on a page? I think this is
> > > > a major loss of oop functionality.
>
> > > > Greetings,
>
> > > > Dennis- Tekst uit oorspronkelijk bericht niet weergeven -
>
> > > - Tekst uit oorspronkelijk bericht weergeven -- Tekst uit oorspronkelijk 
> > > bericht niet weergeven -
>
> - Tekst uit oorspronkelijk bericht weergeven -
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"symfony users" group.
To post to this group, send email to symfony-users@googlegroups.com
To unsubscribe from this group, send email to 
symfony-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/symfony-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to