Customizing viewlet for a single view

classic Classic list List threaded Threaded
11 messages Options
cekk cekk
Reply | Threaded
Open this post in threaded view
|

Customizing viewlet for a single view

Hi all,
i need to customize a default Plone viewlet (skip_links) for a view that are not related with any AT (for example a search view).


In the view class i put "implements(IMYMarkerInterface)", and i registered the viewlet like this:

    <browser:viewlet
        name="plone.skip_links"
        view=".interfaces.IMYMarkerInterface"
        layer=".interfaces.IMyBrowserLayer"
        manager="plone.app.layout.viewlets.interfaces.IPortalHeader"
        class=".my_viewlet_class.MySkipLinksViewlet"
        permission="zope2.View"
        />

But it doesn't works.
It's not a browserlayer problems, because if i remove "view" attribute, it works.

Any ideas?

--
Andrea Cecchi - RedTurtle Technology
E-mail:      andrea.cecchi AT redturtle DOT it
Web site: http://www.redturtle.net
Phone:     +39 0532 1915958
Fax:          +39 0532 287070

------------------------------------------------------------------------------
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_d2d_feb
_______________________________________________
Plone-Users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/plone-users
Nathan Van Gheem Nathan Van Gheem
Reply | Threaded
Open this post in threaded view
|

Re: Customizing viewlet for a single view

Can you share your view definition?


On Thu, Feb 21, 2013 at 7:12 AM, Andrea Cecchi <[hidden email]> wrote:
Hi all,
i need to customize a default Plone viewlet (skip_links) for a view that are not related with any AT (for example a search view).


In the view class i put "implements(IMYMarkerInterface)", and i registered the viewlet like this:

    <browser:viewlet
        name="plone.skip_links"
        view=".interfaces.IMYMarkerInterface"
        layer=".interfaces.IMyBrowserLayer"
        manager="plone.app.layout.viewlets.interfaces.IPortalHeader"
        class=".my_viewlet_class.MySkipLinksViewlet"
        permission="zope2.View"
        />

But it doesn't works.
It's not a browserlayer problems, because if i remove "view" attribute, it works.

Any ideas?

--
Andrea Cecchi - RedTurtle Technology
E-mail:      andrea.cecchi AT redturtle DOT it
Web site: http://www.redturtle.net
Phone:     <a href="tel:%2B39%200532%201915958" value="+3905321915958" target="_blank">+39 0532 1915958
Fax:          <a href="tel:%2B39%200532%20287070" value="+390532287070" target="_blank">+39 0532 287070

------------------------------------------------------------------------------
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_d2d_feb
_______________________________________________
Plone-Users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/plone-users



------------------------------------------------------------------------------
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_d2d_feb
_______________________________________________
Plone-Users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/plone-users
cekk cekk
Reply | Threaded
Open this post in threaded view
|

Re: Customizing viewlet for a single view

<browser:page
        name="search"
        class=".my_view.View"
        permission="zope2.View"
        for="*"
        layer=".interfaces.IMyBrowserLayer"
        template="my_template.pt"
        />


and the view class:

from plone.app.search.browser import Search

class MySearch(Search):
    implements(IMYMarkerInterface)
...

This is what you want to know?

Andrea



2013/2/21 Nathan Van Gheem <[hidden email]>
Can you share your view definition?


On Thu, Feb 21, 2013 at 7:12 AM, Andrea Cecchi <[hidden email]> wrote:
Hi all,
i need to customize a default Plone viewlet (skip_links) for a view that are not related with any AT (for example a search view).


In the view class i put "implements(IMYMarkerInterface)", and i registered the viewlet like this:

    <browser:viewlet
        name="plone.skip_links"
        view=".interfaces.IMYMarkerInterface"
        layer=".interfaces.IMyBrowserLayer"
        manager="plone.app.layout.viewlets.interfaces.IPortalHeader"
        class=".my_viewlet_class.MySkipLinksViewlet"
        permission="zope2.View"
        />

But it doesn't works.
It's not a browserlayer problems, because if i remove "view" attribute, it works.

Any ideas?

--
Andrea Cecchi - RedTurtle Technology
E-mail:      andrea.cecchi AT redturtle DOT it
Web site: http://www.redturtle.net
Phone:     <a href="tel:%2B39%200532%201915958" value="+3905321915958" target="_blank">+39 0532 1915958
Fax:          <a href="tel:%2B39%200532%20287070" value="+390532287070" target="_blank">+39 0532 287070

------------------------------------------------------------------------------
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_d2d_feb
_______________________________________________
Plone-Users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/plone-users





--
Andrea Cecchi - RedTurtle Technology
E-mail:      andrea.cecchi AT redturtle DOT it
Web site: http://www.redturtle.net
Phone:     +39 0532 1915958
Fax:          +39 0532 287070

------------------------------------------------------------------------------
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_d2d_feb
_______________________________________________
Plone-Users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/plone-users
Nathan Van Gheem Nathan Van Gheem
Reply | Threaded
Open this post in threaded view
|

Re: Customizing viewlet for a single view

That doesn't seem to match up.

my_view.View should be the MySearch definition you show.




On Thu, Feb 21, 2013 at 7:34 AM, Andrea Cecchi <[hidden email]> wrote:
<browser:page
        name="search"
        class=".my_view.View"
        permission="zope2.View"
        for="*"
        layer=".interfaces.IMyBrowserLayer"
        template="my_template.pt"
        />


and the view class:

from plone.app.search.browser import Search

class MySearch(Search):
    implements(IMYMarkerInterface)
...

This is what you want to know?

Andrea



2013/2/21 Nathan Van Gheem <[hidden email]>
Can you share your view definition?


On Thu, Feb 21, 2013 at 7:12 AM, Andrea Cecchi <[hidden email]> wrote:
Hi all,
i need to customize a default Plone viewlet (skip_links) for a view that are not related with any AT (for example a search view).


In the view class i put "implements(IMYMarkerInterface)", and i registered the viewlet like this:

    <browser:viewlet
        name="plone.skip_links"
        view=".interfaces.IMYMarkerInterface"
        layer=".interfaces.IMyBrowserLayer"
        manager="plone.app.layout.viewlets.interfaces.IPortalHeader"
        class=".my_viewlet_class.MySkipLinksViewlet"
        permission="zope2.View"
        />

But it doesn't works.
It's not a browserlayer problems, because if i remove "view" attribute, it works.

Any ideas?

--
Andrea Cecchi - RedTurtle Technology
E-mail:      andrea.cecchi AT redturtle DOT it
Web site: http://www.redturtle.net
Phone:     <a href="tel:%2B39%200532%201915958" value="+3905321915958" target="_blank">+39 0532 1915958
Fax:          <a href="tel:%2B39%200532%20287070" value="+390532287070" target="_blank">+39 0532 287070

------------------------------------------------------------------------------
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_d2d_feb
_______________________________________________
Plone-Users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/plone-users





--
Andrea Cecchi - RedTurtle Technology
E-mail:      andrea.cecchi AT redturtle DOT it
Web site: http://www.redturtle.net
Phone:     <a href="tel:%2B39%200532%201915958" value="+3905321915958" target="_blank">+39 0532 1915958
Fax:          <a href="tel:%2B39%200532%20287070" value="+390532287070" target="_blank">+39 0532 287070


------------------------------------------------------------------------------
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_d2d_feb
_______________________________________________
Plone-Users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/plone-users
cekk cekk
Reply | Threaded
Open this post in threaded view
|

Re: Customizing viewlet for a single view

Sorry, i changed the names and i made a typo :(

<browser:page
        name="search"
        class=".my_view.MySearch"
        permission="zope2.View"
        for="*"
        layer=".interfaces.IMyBrowserLayer"
        template="my_template.pt"
        />


and the view class:

from plone.app.search.browser import Search

class MySearch(Search):
    implements(IMYMarkerInterface)



2013/2/21 Nathan Van Gheem <[hidden email]>
That doesn't seem to match up.

my_view.View should be the MySearch definition you show.




On Thu, Feb 21, 2013 at 7:34 AM, Andrea Cecchi <[hidden email]> wrote:
<browser:page
        name="search"
        class=".my_view.View"
        permission="zope2.View"
        for="*"
        layer=".interfaces.IMyBrowserLayer"
        template="my_template.pt"
        />


and the view class:

from plone.app.search.browser import Search

class MySearch(Search):
    implements(IMYMarkerInterface)
...

This is what you want to know?

Andrea



2013/2/21 Nathan Van Gheem <[hidden email]>
Can you share your view definition?


On Thu, Feb 21, 2013 at 7:12 AM, Andrea Cecchi <[hidden email]> wrote:
Hi all,
i need to customize a default Plone viewlet (skip_links) for a view that are not related with any AT (for example a search view).


In the view class i put "implements(IMYMarkerInterface)", and i registered the viewlet like this:

    <browser:viewlet
        name="plone.skip_links"
        view=".interfaces.IMYMarkerInterface"
        layer=".interfaces.IMyBrowserLayer"
        manager="plone.app.layout.viewlets.interfaces.IPortalHeader"
        class=".my_viewlet_class.MySkipLinksViewlet"
        permission="zope2.View"
        />

But it doesn't works.
It's not a browserlayer problems, because if i remove "view" attribute, it works.

Any ideas?

--
Andrea Cecchi - RedTurtle Technology
E-mail:      andrea.cecchi AT redturtle DOT it
Web site: http://www.redturtle.net
Phone:     <a href="tel:%2B39%200532%201915958" value="+3905321915958" target="_blank">+39 0532 1915958
Fax:          <a href="tel:%2B39%200532%20287070" value="+390532287070" target="_blank">+39 0532 287070

------------------------------------------------------------------------------
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_d2d_feb
_______________________________________________
Plone-Users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/plone-users





--
Andrea Cecchi - RedTurtle Technology
E-mail:      andrea.cecchi AT redturtle DOT it
Web site: http://www.redturtle.net
Phone:     <a href="tel:%2B39%200532%201915958" value="+3905321915958" target="_blank">+39 0532 1915958
Fax:          <a href="tel:%2B39%200532%20287070" value="+390532287070" target="_blank">+39 0532 287070




--
Andrea Cecchi - RedTurtle Technology
E-mail:      andrea.cecchi AT redturtle DOT it
Web site: http://www.redturtle.net
Phone:     +39 0532 1915958
Fax:          +39 0532 287070

------------------------------------------------------------------------------
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_d2d_feb
_______________________________________________
Plone-Users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/plone-users
Nathan Van Gheem Nathan Van Gheem
Reply | Threaded
Open this post in threaded view
|

Re: Customizing viewlet for a single view

You sure your MySearch view is getting used. Are you registering IMyBrowserLayer on install?


On Thu, Feb 21, 2013 at 7:42 AM, Andrea Cecchi <[hidden email]> wrote:
Sorry, i changed the names and i made a typo :(

<browser:page
        name="search"
        class=".my_view.MySearch"
        permission="zope2.View"
        for="*"
        layer=".interfaces.IMyBrowserLayer"
        template="my_template.pt"
        />


and the view class:

from plone.app.search.browser import Search

class MySearch(Search):
    implements(IMYMarkerInterface)



2013/2/21 Nathan Van Gheem <[hidden email]>
That doesn't seem to match up.

my_view.View should be the MySearch definition you show.




On Thu, Feb 21, 2013 at 7:34 AM, Andrea Cecchi <[hidden email]> wrote:
<browser:page
        name="search"
        class=".my_view.View"
        permission="zope2.View"
        for="*"
        layer=".interfaces.IMyBrowserLayer"
        template="my_template.pt"
        />


and the view class:

from plone.app.search.browser import Search

class MySearch(Search):
    implements(IMYMarkerInterface)
...

This is what you want to know?

Andrea



2013/2/21 Nathan Van Gheem <[hidden email]>
Can you share your view definition?


On Thu, Feb 21, 2013 at 7:12 AM, Andrea Cecchi <[hidden email]> wrote:
Hi all,
i need to customize a default Plone viewlet (skip_links) for a view that are not related with any AT (for example a search view).


In the view class i put "implements(IMYMarkerInterface)", and i registered the viewlet like this:

    <browser:viewlet
        name="plone.skip_links"
        view=".interfaces.IMYMarkerInterface"
        layer=".interfaces.IMyBrowserLayer"
        manager="plone.app.layout.viewlets.interfaces.IPortalHeader"
        class=".my_viewlet_class.MySkipLinksViewlet"
        permission="zope2.View"
        />

But it doesn't works.
It's not a browserlayer problems, because if i remove "view" attribute, it works.

Any ideas?

--
Andrea Cecchi - RedTurtle Technology
E-mail:      andrea.cecchi AT redturtle DOT it
Web site: http://www.redturtle.net
Phone:     <a href="tel:%2B39%200532%201915958" value="+3905321915958" target="_blank">+39 0532 1915958
Fax:          <a href="tel:%2B39%200532%20287070" value="+390532287070" target="_blank">+39 0532 287070

------------------------------------------------------------------------------
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_d2d_feb
_______________________________________________
Plone-Users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/plone-users





--
Andrea Cecchi - RedTurtle Technology
E-mail:      andrea.cecchi AT redturtle DOT it
Web site: http://www.redturtle.net
Phone:     <a href="tel:%2B39%200532%201915958" value="+3905321915958" target="_blank">+39 0532 1915958
Fax:          <a href="tel:%2B39%200532%20287070" value="+390532287070" target="_blank">+39 0532 287070




--
Andrea Cecchi - RedTurtle Technology
E-mail:      andrea.cecchi AT redturtle DOT it
Web site: http://www.redturtle.net
Phone:     <a href="tel:%2B39%200532%201915958" value="+3905321915958" target="_blank">+39 0532 1915958
Fax:          <a href="tel:%2B39%200532%20287070" value="+390532287070" target="_blank">+39 0532 287070


------------------------------------------------------------------------------
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_d2d_feb
_______________________________________________
Plone-Users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/plone-users
cekk cekk
Reply | Threaded
Open this post in threaded view
|

Re: Customizing viewlet for a single view

Yes,
the view works fine, and as i said, if i remove the "view" attribute on viewlet registration, i see my customizations in the viewlet.


2013/2/21 Nathan Van Gheem <[hidden email]>
You sure your MySearch view is getting used. Are you registering IMyBrowserLayer on install?


On Thu, Feb 21, 2013 at 7:42 AM, Andrea Cecchi <[hidden email]> wrote:
Sorry, i changed the names and i made a typo :(

<browser:page
        name="search"
        class=".my_view.MySearch"
        permission="zope2.View"
        for="*"
        layer=".interfaces.IMyBrowserLayer"
        template="my_template.pt"
        />


and the view class:

from plone.app.search.browser import Search

class MySearch(Search):
    implements(IMYMarkerInterface)



2013/2/21 Nathan Van Gheem <[hidden email]>
That doesn't seem to match up.

my_view.View should be the MySearch definition you show.




On Thu, Feb 21, 2013 at 7:34 AM, Andrea Cecchi <[hidden email]> wrote:
<browser:page
        name="search"
        class=".my_view.View"
        permission="zope2.View"
        for="*"
        layer=".interfaces.IMyBrowserLayer"
        template="my_template.pt"
        />


and the view class:

from plone.app.search.browser import Search

class MySearch(Search):
    implements(IMYMarkerInterface)
...

This is what you want to know?

Andrea



2013/2/21 Nathan Van Gheem <[hidden email]>
Can you share your view definition?


On Thu, Feb 21, 2013 at 7:12 AM, Andrea Cecchi <[hidden email]> wrote:
Hi all,
i need to customize a default Plone viewlet (skip_links) for a view that are not related with any AT (for example a search view).


In the view class i put "implements(IMYMarkerInterface)", and i registered the viewlet like this:

    <browser:viewlet
        name="plone.skip_links"
        view=".interfaces.IMYMarkerInterface"
        layer=".interfaces.IMyBrowserLayer"
        manager="plone.app.layout.viewlets.interfaces.IPortalHeader"
        class=".my_viewlet_class.MySkipLinksViewlet"
        permission="zope2.View"
        />

But it doesn't works.
It's not a browserlayer problems, because if i remove "view" attribute, it works.

Any ideas?

--
Andrea Cecchi - RedTurtle Technology
E-mail:      andrea.cecchi AT redturtle DOT it
Web site: http://www.redturtle.net
Phone:     <a href="tel:%2B39%200532%201915958" value="+3905321915958" target="_blank">+39 0532 1915958
Fax:          <a href="tel:%2B39%200532%20287070" value="+390532287070" target="_blank">+39 0532 287070

------------------------------------------------------------------------------
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_d2d_feb
_______________________________________________
Plone-Users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/plone-users





--
Andrea Cecchi - RedTurtle Technology
E-mail:      andrea.cecchi AT redturtle DOT it
Web site: http://www.redturtle.net
Phone:     <a href="tel:%2B39%200532%201915958" value="+3905321915958" target="_blank">+39 0532 1915958
Fax:          <a href="tel:%2B39%200532%20287070" value="+390532287070" target="_blank">+39 0532 287070




--
Andrea Cecchi - RedTurtle Technology
E-mail:      andrea.cecchi AT redturtle DOT it
Web site: http://www.redturtle.net
Phone:     <a href="tel:%2B39%200532%201915958" value="+3905321915958" target="_blank">+39 0532 1915958
Fax:          <a href="tel:%2B39%200532%20287070" value="+390532287070" target="_blank">+39 0532 287070




--
Andrea Cecchi - RedTurtle Technology
E-mail:      andrea.cecchi AT redturtle DOT it
Web site: http://www.redturtle.net
Phone:     +39 0532 1915958
Fax:          +39 0532 287070

------------------------------------------------------------------------------
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_d2d_feb
_______________________________________________
Plone-Users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/plone-users
Nathan Van Gheem Nathan Van Gheem
Reply | Threaded
Open this post in threaded view
|

Re: Customizing viewlet for a single view

Can you try removing the "layer=" setting to the viewlet definition when using it with the "view=" setting?

Maybe it only looks at one or the other and since your view is already only registered for the layer, once you get the the viewlet picking up with your view, it should work the way you expect.

So, try:

    <browser:viewlet
        name="plone.skip_links"
        view=".interfaces.IMYMarkerInterface"
        manager="plone.app.layout.viewlets.interfaces.IPortalHeader"
        class=".my_viewlet_class.MySkipLinksViewlet"
        permission="zope2.View"
        />


On Thu, Feb 21, 2013 at 7:49 AM, Andrea Cecchi <[hidden email]> wrote:
Yes,
the view works fine, and as i said, if i remove the "view" attribute on viewlet registration, i see my customizations in the viewlet.


2013/2/21 Nathan Van Gheem <[hidden email]>
You sure your MySearch view is getting used. Are you registering IMyBrowserLayer on install?


On Thu, Feb 21, 2013 at 7:42 AM, Andrea Cecchi <[hidden email]> wrote:
Sorry, i changed the names and i made a typo :(

<browser:page
        name="search"
        class=".my_view.MySearch"
        permission="zope2.View"
        for="*"
        layer=".interfaces.IMyBrowserLayer"
        template="my_template.pt"
        />


and the view class:

from plone.app.search.browser import Search

class MySearch(Search):
    implements(IMYMarkerInterface)



2013/2/21 Nathan Van Gheem <[hidden email]>
That doesn't seem to match up.

my_view.View should be the MySearch definition you show.




On Thu, Feb 21, 2013 at 7:34 AM, Andrea Cecchi <[hidden email]> wrote:
<browser:page
        name="search"
        class=".my_view.View"
        permission="zope2.View"
        for="*"
        layer=".interfaces.IMyBrowserLayer"
        template="my_template.pt"
        />


and the view class:

from plone.app.search.browser import Search

class MySearch(Search):
    implements(IMYMarkerInterface)
...

This is what you want to know?

Andrea



2013/2/21 Nathan Van Gheem <[hidden email]>
Can you share your view definition?


On Thu, Feb 21, 2013 at 7:12 AM, Andrea Cecchi <[hidden email]> wrote:
Hi all,
i need to customize a default Plone viewlet (skip_links) for a view that are not related with any AT (for example a search view).


In the view class i put "implements(IMYMarkerInterface)", and i registered the viewlet like this:

    <browser:viewlet
        name="plone.skip_links"
        view=".interfaces.IMYMarkerInterface"
        layer=".interfaces.IMyBrowserLayer"
        manager="plone.app.layout.viewlets.interfaces.IPortalHeader"
        class=".my_viewlet_class.MySkipLinksViewlet"
        permission="zope2.View"
        />

But it doesn't works.
It's not a browserlayer problems, because if i remove "view" attribute, it works.

Any ideas?

--
Andrea Cecchi - RedTurtle Technology
E-mail:      andrea.cecchi AT redturtle DOT it
Web site: http://www.redturtle.net
Phone:     <a href="tel:%2B39%200532%201915958" value="+3905321915958" target="_blank">+39 0532 1915958
Fax:          <a href="tel:%2B39%200532%20287070" value="+390532287070" target="_blank">+39 0532 287070

------------------------------------------------------------------------------
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_d2d_feb
_______________________________________________
Plone-Users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/plone-users





--
Andrea Cecchi - RedTurtle Technology
E-mail:      andrea.cecchi AT redturtle DOT it
Web site: http://www.redturtle.net
Phone:     <a href="tel:%2B39%200532%201915958" value="+3905321915958" target="_blank">+39 0532 1915958
Fax:          <a href="tel:%2B39%200532%20287070" value="+390532287070" target="_blank">+39 0532 287070




--
Andrea Cecchi - RedTurtle Technology
E-mail:      andrea.cecchi AT redturtle DOT it
Web site: http://www.redturtle.net
Phone:     <a href="tel:%2B39%200532%201915958" value="+3905321915958" target="_blank">+39 0532 1915958
Fax:          <a href="tel:%2B39%200532%20287070" value="+390532287070" target="_blank">+39 0532 287070




--
Andrea Cecchi - RedTurtle Technology
E-mail:      andrea.cecchi AT redturtle DOT it
Web site: http://www.redturtle.net
Phone:     <a href="tel:%2B39%200532%201915958" value="+3905321915958" target="_blank">+39 0532 1915958
Fax:          <a href="tel:%2B39%200532%20287070" value="+390532287070" target="_blank">+39 0532 287070


------------------------------------------------------------------------------
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_d2d_feb
_______________________________________________
Plone-Users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/plone-users
cekk cekk
Reply | Threaded
Open this post in threaded view
|

Re: Customizing viewlet for a single view

mmmm..no.
Without layer it doesn't change anything.
The strange thing is that with "name" and without "layer" the instance goes up correctly,
but without "name" and "layer" it raises a conflict error (that's right because i'm overriding a default plone viewlet: plone.skip_links).

Strange things appens here


2013/2/21 Nathan Van Gheem <[hidden email]>
Can you try removing the "layer=" setting to the viewlet definition when using it with the "view=" setting?

Maybe it only looks at one or the other and since your view is already only registered for the layer, once you get the the viewlet picking up with your view, it should work the way you expect.

So, try:

    <browser:viewlet
        name="plone.skip_links"
        view=".interfaces.IMYMarkerInterface"
        manager="plone.app.layout.viewlets.interfaces.IPortalHeader"
        class=".my_viewlet_class.MySkipLinksViewlet"
        permission="zope2.View"
        />


On Thu, Feb 21, 2013 at 7:49 AM, Andrea Cecchi <[hidden email]> wrote:
Yes,
the view works fine, and as i said, if i remove the "view" attribute on viewlet registration, i see my customizations in the viewlet.


2013/2/21 Nathan Van Gheem <[hidden email]>
You sure your MySearch view is getting used. Are you registering IMyBrowserLayer on install?


On Thu, Feb 21, 2013 at 7:42 AM, Andrea Cecchi <[hidden email]> wrote:
Sorry, i changed the names and i made a typo :(

<browser:page
        name="search"
        class=".my_view.MySearch"
        permission="zope2.View"
        for="*"
        layer=".interfaces.IMyBrowserLayer"
        template="my_template.pt"
        />


and the view class:

from plone.app.search.browser import Search

class MySearch(Search):
    implements(IMYMarkerInterface)



2013/2/21 Nathan Van Gheem <[hidden email]>
That doesn't seem to match up.

my_view.View should be the MySearch definition you show.




On Thu, Feb 21, 2013 at 7:34 AM, Andrea Cecchi <[hidden email]> wrote:
<browser:page
        name="search"
        class=".my_view.View"
        permission="zope2.View"
        for="*"
        layer=".interfaces.IMyBrowserLayer"
        template="my_template.pt"
        />


and the view class:

from plone.app.search.browser import Search

class MySearch(Search):
    implements(IMYMarkerInterface)
...

This is what you want to know?

Andrea



2013/2/21 Nathan Van Gheem <[hidden email]>
Can you share your view definition?


On Thu, Feb 21, 2013 at 7:12 AM, Andrea Cecchi <[hidden email]> wrote:
Hi all,
i need to customize a default Plone viewlet (skip_links) for a view that are not related with any AT (for example a search view).


In the view class i put "implements(IMYMarkerInterface)", and i registered the viewlet like this:

    <browser:viewlet
        name="plone.skip_links"
        view=".interfaces.IMYMarkerInterface"
        layer=".interfaces.IMyBrowserLayer"
        manager="plone.app.layout.viewlets.interfaces.IPortalHeader"
        class=".my_viewlet_class.MySkipLinksViewlet"
        permission="zope2.View"
        />

But it doesn't works.
It's not a browserlayer problems, because if i remove "view" attribute, it works.

Any ideas?

--
Andrea Cecchi - RedTurtle Technology
E-mail:      andrea.cecchi AT redturtle DOT it
Web site: http://www.redturtle.net
Phone:     <a href="tel:%2B39%200532%201915958" value="+3905321915958" target="_blank">+39 0532 1915958
Fax:          <a href="tel:%2B39%200532%20287070" value="+390532287070" target="_blank">+39 0532 287070

------------------------------------------------------------------------------
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_d2d_feb
_______________________________________________
Plone-Users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/plone-users





--
Andrea Cecchi - RedTurtle Technology
E-mail:      andrea.cecchi AT redturtle DOT it
Web site: http://www.redturtle.net
Phone:     <a href="tel:%2B39%200532%201915958" value="+3905321915958" target="_blank">+39 0532 1915958
Fax:          <a href="tel:%2B39%200532%20287070" value="+390532287070" target="_blank">+39 0532 287070




--
Andrea Cecchi - RedTurtle Technology
E-mail:      andrea.cecchi AT redturtle DOT it
Web site: http://www.redturtle.net
Phone:     <a href="tel:%2B39%200532%201915958" value="+3905321915958" target="_blank">+39 0532 1915958
Fax:          <a href="tel:%2B39%200532%20287070" value="+390532287070" target="_blank">+39 0532 287070




--
Andrea Cecchi - RedTurtle Technology
E-mail:      andrea.cecchi AT redturtle DOT it
Web site: http://www.redturtle.net
Phone:     <a href="tel:%2B39%200532%201915958" value="+3905321915958" target="_blank">+39 0532 1915958
Fax:          <a href="tel:%2B39%200532%20287070" value="+390532287070" target="_blank">+39 0532 287070




--
Andrea Cecchi - RedTurtle Technology
E-mail:      andrea.cecchi AT redturtle DOT it
Web site: http://www.redturtle.net
Phone:     +39 0532 1915958
Fax:          +39 0532 287070

------------------------------------------------------------------------------
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_d2d_feb
_______________________________________________
Plone-Users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/plone-users
Nathan Van Gheem Nathan Van Gheem
Reply | Threaded
Open this post in threaded view
|

Re: Customizing viewlet for a single view

can you try making IMYMarkerInterface inherit IViewView. So something like

from plone.app.layout.globals.interfaces import IViewView

class IMYMarkerInterface(IViewView):
    pass


Worth a try, not sure it'll work...


On Thu, Feb 21, 2013 at 9:32 AM, Andrea Cecchi <[hidden email]> wrote:
mmmm..no.
Without layer it doesn't change anything.
The strange thing is that with "name" and without "layer" the instance goes up correctly,
but without "name" and "layer" it raises a conflict error (that's right because i'm overriding a default plone viewlet: plone.skip_links).

Strange things appens here


2013/2/21 Nathan Van Gheem <[hidden email]>
Can you try removing the "layer=" setting to the viewlet definition when using it with the "view=" setting?

Maybe it only looks at one or the other and since your view is already only registered for the layer, once you get the the viewlet picking up with your view, it should work the way you expect.

So, try:

    <browser:viewlet
        name="plone.skip_links"
        view=".interfaces.IMYMarkerInterface"
        manager="plone.app.layout.viewlets.interfaces.IPortalHeader"
        class=".my_viewlet_class.MySkipLinksViewlet"
        permission="zope2.View"
        />


On Thu, Feb 21, 2013 at 7:49 AM, Andrea Cecchi <[hidden email]> wrote:
Yes,
the view works fine, and as i said, if i remove the "view" attribute on viewlet registration, i see my customizations in the viewlet.


2013/2/21 Nathan Van Gheem <[hidden email]>
You sure your MySearch view is getting used. Are you registering IMyBrowserLayer on install?


On Thu, Feb 21, 2013 at 7:42 AM, Andrea Cecchi <[hidden email]> wrote:
Sorry, i changed the names and i made a typo :(

<browser:page
        name="search"
        class=".my_view.MySearch"
        permission="zope2.View"
        for="*"
        layer=".interfaces.IMyBrowserLayer"
        template="my_template.pt"
        />


and the view class:

from plone.app.search.browser import Search

class MySearch(Search):
    implements(IMYMarkerInterface)



2013/2/21 Nathan Van Gheem <[hidden email]>
That doesn't seem to match up.

my_view.View should be the MySearch definition you show.




On Thu, Feb 21, 2013 at 7:34 AM, Andrea Cecchi <[hidden email]> wrote:
<browser:page
        name="search"
        class=".my_view.View"
        permission="zope2.View"
        for="*"
        layer=".interfaces.IMyBrowserLayer"
        template="my_template.pt"
        />


and the view class:

from plone.app.search.browser import Search

class MySearch(Search):
    implements(IMYMarkerInterface)
...

This is what you want to know?

Andrea



2013/2/21 Nathan Van Gheem <[hidden email]>
Can you share your view definition?


On Thu, Feb 21, 2013 at 7:12 AM, Andrea Cecchi <[hidden email]> wrote:
Hi all,
i need to customize a default Plone viewlet (skip_links) for a view that are not related with any AT (for example a search view).


In the view class i put "implements(IMYMarkerInterface)", and i registered the viewlet like this:

    <browser:viewlet
        name="plone.skip_links"
        view=".interfaces.IMYMarkerInterface"
        layer=".interfaces.IMyBrowserLayer"
        manager="plone.app.layout.viewlets.interfaces.IPortalHeader"
        class=".my_viewlet_class.MySkipLinksViewlet"
        permission="zope2.View"
        />

But it doesn't works.
It's not a browserlayer problems, because if i remove "view" attribute, it works.

Any ideas?

--
Andrea Cecchi - RedTurtle Technology
E-mail:      andrea.cecchi AT redturtle DOT it
Web site: http://www.redturtle.net
Phone:     <a href="tel:%2B39%200532%201915958" value="+3905321915958" target="_blank">+39 0532 1915958
Fax:          <a href="tel:%2B39%200532%20287070" value="+390532287070" target="_blank">+39 0532 287070

------------------------------------------------------------------------------
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_d2d_feb
_______________________________________________
Plone-Users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/plone-users





--
Andrea Cecchi - RedTurtle Technology
E-mail:      andrea.cecchi AT redturtle DOT it
Web site: http://www.redturtle.net
Phone:     <a href="tel:%2B39%200532%201915958" value="+3905321915958" target="_blank">+39 0532 1915958
Fax:          <a href="tel:%2B39%200532%20287070" value="+390532287070" target="_blank">+39 0532 287070




--
Andrea Cecchi - RedTurtle Technology
E-mail:      andrea.cecchi AT redturtle DOT it
Web site: http://www.redturtle.net
Phone:     <a href="tel:%2B39%200532%201915958" value="+3905321915958" target="_blank">+39 0532 1915958
Fax:          <a href="tel:%2B39%200532%20287070" value="+390532287070" target="_blank">+39 0532 287070




--
Andrea Cecchi - RedTurtle Technology
E-mail:      andrea.cecchi AT redturtle DOT it
Web site: http://www.redturtle.net
Phone:     <a href="tel:%2B39%200532%201915958" value="+3905321915958" target="_blank">+39 0532 1915958
Fax:          <a href="tel:%2B39%200532%20287070" value="+390532287070" target="_blank">+39 0532 287070




--
Andrea Cecchi - RedTurtle Technology
E-mail:      andrea.cecchi AT redturtle DOT it
Web site: http://www.redturtle.net
Phone:     <a href="tel:%2B39%200532%201915958" value="+3905321915958" target="_blank">+39 0532 1915958
Fax:          <a href="tel:%2B39%200532%20287070" value="+390532287070" target="_blank">+39 0532 287070


------------------------------------------------------------------------------
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_d2d_feb
_______________________________________________
Plone-Users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/plone-users
cekk cekk
Reply | Threaded
Open this post in threaded view
|

Re: Customizing viewlet for a single view

Same result..it doesn't work :(

Now, i've tried to remove "view" and add "layer", and i make this check in viewlet's update method. I don't know if it is the best, but it works:

for item in self.aq_chain:
    if IMYMarkerInterface.providedBy(item):
        is_search_view = True
        return True
return False



2013/2/21 Nathan Van Gheem <[hidden email]>
can you try making IMYMarkerInterface inherit IViewView. So something like

from plone.app.layout.globals.interfaces import IViewView

class IMYMarkerInterface(IViewView):
    pass


Worth a try, not sure it'll work...


On Thu, Feb 21, 2013 at 9:32 AM, Andrea Cecchi <[hidden email]> wrote:
mmmm..no.
Without layer it doesn't change anything.
The strange thing is that with "name" and without "layer" the instance goes up correctly,
but without "name" and "layer" it raises a conflict error (that's right because i'm overriding a default plone viewlet: plone.skip_links).

Strange things appens here


2013/2/21 Nathan Van Gheem <[hidden email]>
Can you try removing the "layer=" setting to the viewlet definition when using it with the "view=" setting?

Maybe it only looks at one or the other and since your view is already only registered for the layer, once you get the the viewlet picking up with your view, it should work the way you expect.

So, try:

    <browser:viewlet
        name="plone.skip_links"
        view=".interfaces.IMYMarkerInterface"
        manager="plone.app.layout.viewlets.interfaces.IPortalHeader"
        class=".my_viewlet_class.MySkipLinksViewlet"
        permission="zope2.View"
        />


On Thu, Feb 21, 2013 at 7:49 AM, Andrea Cecchi <[hidden email]> wrote:
Yes,
the view works fine, and as i said, if i remove the "view" attribute on viewlet registration, i see my customizations in the viewlet.


2013/2/21 Nathan Van Gheem <[hidden email]>
You sure your MySearch view is getting used. Are you registering IMyBrowserLayer on install?


On Thu, Feb 21, 2013 at 7:42 AM, Andrea Cecchi <[hidden email]> wrote:
Sorry, i changed the names and i made a typo :(

<browser:page
        name="search"
        class=".my_view.MySearch"
        permission="zope2.View"
        for="*"
        layer=".interfaces.IMyBrowserLayer"
        template="my_template.pt"
        />


and the view class:

from plone.app.search.browser import Search

class MySearch(Search):
    implements(IMYMarkerInterface)



2013/2/21 Nathan Van Gheem <[hidden email]>
That doesn't seem to match up.

my_view.View should be the MySearch definition you show.




On Thu, Feb 21, 2013 at 7:34 AM, Andrea Cecchi <[hidden email]> wrote:
<browser:page
        name="search"
        class=".my_view.View"
        permission="zope2.View"
        for="*"
        layer=".interfaces.IMyBrowserLayer"
        template="my_template.pt"
        />


and the view class:

from plone.app.search.browser import Search

class MySearch(Search):
    implements(IMYMarkerInterface)
...

This is what you want to know?

Andrea



2013/2/21 Nathan Van Gheem <[hidden email]>
Can you share your view definition?


On Thu, Feb 21, 2013 at 7:12 AM, Andrea Cecchi <[hidden email]> wrote:
Hi all,
i need to customize a default Plone viewlet (skip_links) for a view that are not related with any AT (for example a search view).


In the view class i put "implements(IMYMarkerInterface)", and i registered the viewlet like this:

    <browser:viewlet
        name="plone.skip_links"
        view=".interfaces.IMYMarkerInterface"
        layer=".interfaces.IMyBrowserLayer"
        manager="plone.app.layout.viewlets.interfaces.IPortalHeader"
        class=".my_viewlet_class.MySkipLinksViewlet"
        permission="zope2.View"
        />

But it doesn't works.
It's not a browserlayer problems, because if i remove "view" attribute, it works.

Any ideas?

--
Andrea Cecchi - RedTurtle Technology
E-mail:      andrea.cecchi AT redturtle DOT it
Web site: http://www.redturtle.net
Phone:     <a href="tel:%2B39%200532%201915958" value="+3905321915958" target="_blank">+39 0532 1915958
Fax:          <a href="tel:%2B39%200532%20287070" value="+390532287070" target="_blank">+39 0532 287070

------------------------------------------------------------------------------
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_d2d_feb
_______________________________________________
Plone-Users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/plone-users





--
Andrea Cecchi - RedTurtle Technology
E-mail:      andrea.cecchi AT redturtle DOT it
Web site: http://www.redturtle.net
Phone:     <a href="tel:%2B39%200532%201915958" value="+3905321915958" target="_blank">+39 0532 1915958
Fax:          <a href="tel:%2B39%200532%20287070" value="+390532287070" target="_blank">+39 0532 287070




--
Andrea Cecchi - RedTurtle Technology
E-mail:      andrea.cecchi AT redturtle DOT it
Web site: http://www.redturtle.net
Phone:     <a href="tel:%2B39%200532%201915958" value="+3905321915958" target="_blank">+39 0532 1915958
Fax:          <a href="tel:%2B39%200532%20287070" value="+390532287070" target="_blank">+39 0532 287070




--
Andrea Cecchi - RedTurtle Technology
E-mail:      andrea.cecchi AT redturtle DOT it
Web site: http://www.redturtle.net
Phone:     <a href="tel:%2B39%200532%201915958" value="+3905321915958" target="_blank">+39 0532 1915958
Fax:          <a href="tel:%2B39%200532%20287070" value="+390532287070" target="_blank">+39 0532 287070




--
Andrea Cecchi - RedTurtle Technology
E-mail:      andrea.cecchi AT redturtle DOT it
Web site: http://www.redturtle.net
Phone:     <a href="tel:%2B39%200532%201915958" value="+3905321915958" target="_blank">+39 0532 1915958
Fax:          <a href="tel:%2B39%200532%20287070" value="+390532287070" target="_blank">+39 0532 287070




--
Andrea Cecchi - RedTurtle Technology
E-mail:      andrea.cecchi AT redturtle DOT it
Web site: http://www.redturtle.net
Phone:     +39 0532 1915958
Fax:          +39 0532 287070

------------------------------------------------------------------------------
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_d2d_feb
_______________________________________________
Plone-Users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/plone-users