Nested pages

32 views
Skip to first unread message

Sam

unread,
May 17, 2013, 6:17:49 AM5/17/13
to mezzani...@googlegroups.com
Hi,

I am probably missing something obvious here but I could not find anything about this in the documentation, or in this google group. 

I have a model Project(Displayable, models.Model).
And the following pages structure:
Projects (Richtextpage)
-- New project (Richtextpage)
-- Detail (Richtextpage)
-- Edit (Richtextpage)

Each of these pages have their own custom views. Now I would like to have the mezzanine page projects/detail trigger on some url. For detail this would become /projects/project-id/project-slug/. For edit this would become /projects/project-id/project-slug/edit/. Normally I would use a regex in the urls but since I work with the mezzanine page I have to supply a url on the page object instead. How can this be achieved? 

Thanks

Josh Cartmell

unread,
May 17, 2013, 12:14:56 PM5/17/13
to mezzani...@googlegroups.com
I don't think I completely understand what you are trying to accomplish, but you would probably be better off writing normal Django views and not having those be pages.  Pages only respond to a single slug and are not like urls which pass arguments to their associated view functions.  Is there any particular reason they need to be pages in the page tree?

The mezzanine blog app is an example of something that deals with pages (there is generally a blog page) but overrides the urls and implements it's own custom logic.  I would take a look at how it works and see if it gives you any guidance.  Good luck, let us know how it goes!

Regards,
Josh


--
You received this message because you are subscribed to the Google Groups "Mezzanine Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mezzanine-use...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Reply all
Reply to author
Forward
0 new messages