Remove Stylesheets and javascripts

25 views
Skip to the first unread message

Philippe Mangé

unread,
8 Mar 2014, 14:00:3408/03/2014
to diem-...@googlegroups.com
Hi

Someone got an idea how to remove all loaded stylesheets and javascripts through for a specific module ?

thx a lot

Philippe

TheCelavi

unread,
9 Mar 2014, 19:55:4409/03/2014
to diem-...@googlegroups.com
See: /diem/dmCorePlugin/lib/response/dmWebResponse.php

Two methods that you are looking for are:


    public function clearStylesheets()
    public function clearJavascripts()

Depending on your problem context - you will have to call them... somewhere... 

Hope this helps...

Philippe Mangé

unread,
10 Mar 2014, 08:02:1810/03/2014
to diem-...@googlegroups.com
Hi TheCelavi

Thx for you reply.
I have tried the following methods.
     $this->getResponse()->clearJavascripts();
     $this->getResponse()->clearStylesheets();
But it seems that it only has effect on the  /dmCorePlugin/lib/*
The one i added in my view.yml are not possible.



Op maandag 10 maart 2014 00:55:44 UTC+1 schreef TheCelavi:

Jörg Wegner

unread,
10 Mar 2014, 10:29:3910/03/2014
to diem-...@googlegroups.com
Hi Philippe,

You can listen to

dm.layout.filter_stylesheets
dm.layout.filter_javascripts

and unset all stylessheets / javascript files completely.

See also:
http://diem-project.org/diem-5-1/doc/en/reference-book/events#events-list:front-events:dm-layout-filter_stylesheets


HTH
Jörg
> --
>
> ---
> You received this message because you are subscribed to the Google
> Groups "diem-users" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to diem-users+...@googlegroups.com
> <mailto:diem-users+...@googlegroups.com>.
> For more options, visit https://groups.google.com/d/optout.

Philippe Mangé

unread,
10 Mar 2014, 17:03:4010/03/2014
to diem-...@googlegroups.com, wegner...@gmx.de
Hi Jorg

Thx for your message.
I am stuck with this event-handling. I can not find the documentation to help me out.

You mention to listen to dm.layout.filter_stylesheets  and dm.layout.filter_javascripts, but i have no idea how to start it ?

any help would be great

Philippe


Op maandag 10 maart 2014 15:29:39 UTC+1 schreef Jörg Wegner:

Jörg Wegner

unread,
11 Mar 2014, 09:57:2311/03/2014
to diem-...@googlegroups.com
Hi Philippe,

The documentation explains how to setup listeners for the frontend:

http://diem-project.org/diem-5-1/doc/en/reference-book/events#working-with-events

You can add this in class frontConfiguration

public function configure()
{
...

$this->dispatcher->connect('dm.layout.filter_stylesheets',array($this,'listenToLayoutFilterStylesheets'));
}

class frontConfiguration extends dmFrontApplicationConfiguration
{
...
public function listenToLayoutFilterStylesheets(sfEvent$e,$styles) {

if(<condition>) {
// unset all styles
$styles = array();
}
return $styles;
}
}


HTH
Jörg
> > an email to diem-users+...@googlegroups.com <javascript:>
> > <mailto:diem-users+...@googlegroups.com <javascript:>>.
> > For more options, visit https://groups.google.com/d/optout
> <https://groups.google.com/d/optout>.
>
> --
>
> ---
> You received this message because you are subscribed to the Google
> Groups "diem-users" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to diem-users+...@googlegroups.com
> <mailto:diem-users+...@googlegroups.com>.

Philippe Mangé

unread,
11 Mar 2014, 15:11:4711/03/2014
to diem-...@googlegroups.com, wegner...@gmx.de
Thx a lot !!! I Owe you big time !

Op dinsdag 11 maart 2014 14:57:23 UTC+1 schreef Jörg Wegner:
>     > <mailto:diem-users+unsub...@googlegroups.com <javascript:>>.
>     > For more options, visit https://groups.google.com/d/optout
>     <https://groups.google.com/d/optout>.
>
> --
>
> ---
> You received this message because you are subscribed to the Google
> Groups "diem-users" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to diem-users+...@googlegroups.com

Jörg Wegner

unread,
11 Mar 2014, 15:40:3511/03/2014
to diem-...@googlegroups.com
On 03/11/2014 08:11 PM, Philippe Mangé wrote:
> Thx a lot !!! I Owe you big time !

Thx for your feedback. Glad i could help.
> > > <mailto:diem-users+...@googlegroups.com
> <javascript:> <javascript:>>.
> > > For more options, visit https://groups.google.com/d/optout
> <https://groups.google.com/d/optout>
> > <https://groups.google.com/d/optout
> <https://groups.google.com/d/optout>>.
> >
> > --
> >
> > ---
> > You received this message because you are subscribed to the Google
> > Groups "diem-users" group.
> > To unsubscribe from this group and stop receiving emails from it,
> send
> > an email to diem-users+...@googlegroups.com <javascript:>
> > <mailto:diem-users+...@googlegroups.com <javascript:>>.
> > For more options, visit https://groups.google.com/d/optout
> <https://groups.google.com/d/optout>.
>
> --
>
> ---
> You received this message because you are subscribed to the Google
> Groups "diem-users" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to diem-users+...@googlegroups.com
> <mailto:diem-users+...@googlegroups.com>.
Reply all
Reply to author
Forward
0 new messages