Dexterity Content Type: Two different Views

classic Classic list List threaded Threaded
4 messages Options
andreasma andreasma
Reply | Threaded
Open this post in threaded view
|

Dexterity Content Type: Two different Views

Hello,

I'm thinking about creating a second view for a Dexterity content folder type. The content type is named 'program'. It's default view shows only the tracks with some additional information but not the talks and workshops inside the tracks. I want to add a new view, that list the whole program.

I use grok.view. It is not posible to add two view names to the View class. Is there a way to add that second and display it using @@? Had I to create a browser view for that?

Thanks for any hints
Andreas
--
Diese Nachricht wurde von meinem Android Mobiltelefon mit GMX Mail gesendet.
------------------------------------------------------------------------------
October Webinars: Code for Performance
Free Intel webinars can help you accelerate application performance.
Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from
the latest Intel processors and coprocessors. See abstracts and register >
http://pubads.g.doubleclick.net/gampad/clk?id=60134791&iu=/4140/ostg.clktrk
_______________________________________________
Plone-Users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/plone-users
Dieter Maurer Dieter Maurer
Reply | Threaded
Open this post in threaded view
|

Re: Dexterity Content Type: Two different Views

Andreas Mantke <[hidden email]> writes:

> ...
> I use grok.view. It is not posible to add two view names to the View class. Is there a way to add that second and display it using @@?

Have you checked whether "grok.view" lets you specify a name for the
view. Should this be the case, you might have a way to add
more views to the class - (with different names, of course).

>Had I to create a browser view for that?

Obviously, that is an option.

Other options:

  *  Derive a new class from the old one - essentially empty,
     apart from a new "view" declaration

  *  Register the second view yourself with the component
     registry


------------------------------------------------------------------------------
October Webinars: Code for Performance
Free Intel webinars can help you accelerate application performance.
Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from
the latest Intel processors and coprocessors. See abstracts and register >
http://pubads.g.doubleclick.net/gampad/clk?id=60134791&iu=/4140/ostg.clktrk
_______________________________________________
Plone-Users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/plone-users
Marcos Romero Marcos Romero
Reply | Threaded
Open this post in threaded view
|

Re: Dexterity Content Type: Two different Views

You can specify the name of the view by grok.name('name')
Check here:

There are two different views: "view" and "standard".

Hope this helps


On Fri, Oct 4, 2013 at 3:13 AM, dieter <[hidden email]> wrote:
Andreas Mantke <[hidden email]> writes:

> ...
> I use grok.view. It is not posible to add two view names to the View class. Is there a way to add that second and display it using @@?

Have you checked whether "grok.view" lets you specify a name for the
view. Should this be the case, you might have a way to add
more views to the class - (with different names, of course).

>Had I to create a browser view for that?

Obviously, that is an option.

Other options:

  *  Derive a new class from the old one - essentially empty,
     apart from a new "view" declaration

  *  Register the second view yourself with the component
     registry


------------------------------------------------------------------------------
October Webinars: Code for Performance
Free Intel webinars can help you accelerate application performance.
Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from
the latest Intel processors and coprocessors. See abstracts and register >
http://pubads.g.doubleclick.net/gampad/clk?id=60134791&iu=/4140/ostg.clktrk
_______________________________________________
Plone-Users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/plone-users



--
Marcos F. Romero
Responsable de Desarrollo
Inter-Cultura

[hidden email]
www.inter-cultura.com
+54 11 4542-8299

------------------------------------------------------------------------------
October Webinars: Code for Performance
Free Intel webinars can help you accelerate application performance.
Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from
the latest Intel processors and coprocessors. See abstracts and register >
http://pubads.g.doubleclick.net/gampad/clk?id=60134791&iu=/4140/ostg.clktrk
_______________________________________________
Plone-Users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/plone-users
andreasma andreasma
Reply | Threaded
Open this post in threaded view
|

Re: Dexterity Content Type: Two different Views

Hello,

Am 04.10.2013 15:17, schrieb Marcos Romero:
You can specify the name of the view by grok.name('name')
Check here:

There are two different views: "view" and "standard".

Hope this helps


On Fri, Oct 4, 2013 at 3:13 AM, dieter <[hidden email]> wrote:
Andreas Mantke <[hidden email]> writes:

> ...
> I use grok.view. It is not posible to add two view names to the View class. Is there a way to add that second and display it using @@?

Have you checked whether "grok.view" lets you specify a name for the
view. Should this be the case, you might have a way to add
more views to the class - (with different names, of course).

>Had I to create a browser view for that?

Obviously, that is an option.

Other options:

  *  Derive a new class from the old one - essentially empty,
     apart from a new "view" declaration

  *  Register the second view yourself with the component
     registry



thanks for your hints. I got the solution from the link to collective.cover. I created a second view class with a new name of the view and a template name:

class Fullprogram(grok.View):
    grok.context(IProgram)
    grok.require('zope2.View')
    grok.name('programfullview')
    grok.template('programfullview')

It's now possible to reach the second view with @@programfullview.

Best regards,
Andreas
-- 
## Developer LibreOffice
## Freie Office-Suite für Linux, Mac, Windows
## http://LibreOffice.org
## Support the Document Foundation (http://documentfoundation.org)
## Meine Seite: http://www.amantke.de 

------------------------------------------------------------------------------
October Webinars: Code for Performance
Free Intel webinars can help you accelerate application performance.
Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from
the latest Intel processors and coprocessors. See abstracts and register >
http://pubads.g.doubleclick.net/gampad/clk?id=60134791&iu=/4140/ostg.clktrk
_______________________________________________
Plone-Users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/plone-users