[Grok-dev] Folders for nested pages in Grok
Sebastian Ware
sebastian at urbantalk.se
Tue Jan 5 05:40:45 EST 2010
I would create objects based on grok.Container and create management
views on that. (The simple approach)
Or I would have a simple grok.Model based object with a grok.Container
attribute. (The more complex approach)
In the latter case I might even use adapters to separate the logic of
adding the containment support at runtime and providing CRUD (i.e. I
would end up with a model and two adapters with context being one of
two marker interfaces ICanBeMadeIntoAContainer, IAmAContainer)
def blessAsContainer(self):
if not hasattr(self.context, 'content'):
self.context.content = grok.Container()
# and probably add some marker interface
Mvh Sebastian
5 jan 2010 kl. 07.45 skrev Dan Jacka:
> Hi people,
>
> What are my choices for simple nested pages in a Grok site?
>
> For example, I have a Page model and want my logged-in users to be
> able
> to create/edit/delete Page objects in the UI so that they can easily
> create paths like:
>
> mysite.com/about
> mysite.com/about/bio
> mysite.com/about/contact
>
> ... all of which are URLs to Pages.
>
> Coming from Plone, my inclination is to have a Folder model. I'll be
> able to set which of its contained Pages appears as the default
> page. So
> in the example above, 'about' is a Folder with a page (called 'index'
> maybe?) set as the default.
>
> What's the Grok way? Do I subclass grok.Container and create all the
> views and functionality myself, or should I (can I?) start from
> zope.app.folder? Can I do the latter without my users having to see
> the
> ZMI?
>
> Or should I be putting my Plone-centric Folder thinking to one side?
>
> Pointers in the right direction much appreciated. I'm using Grok 1.0.
>
> Thanks,
> Dan
>
>
>
>
> _______________________________________________
> Grok-dev mailing list
> Grok-dev at zope.org
> https://mail.zope.org/mailman/listinfo/grok-dev
More information about the Grok-dev
mailing list