On Mon, Nov 3, 2008 at 2:48 AM, ilmarik <[EMAIL PROTECTED]> wrote: > I've got controllers made as logical apps (controllers named > particularly) and whenever I need f.e. menu inside base layout, I > simply put {#menus/show/1} which means - return here compiled > controllers(menus) method(show) of menu with id (1). > This gives me the power to return response to any template from any > controllers 'public' method. [snip] > custom tags are just to much fuss for me but if it IS django's way to > create full portal template, fine. > or mayby there is one, more intuitive, simple, better ?
The controllers that you use for your current implementation would be the same thing as an inclusion tag in django. Generally what I do when developing a new inclusion tag is to create a new view, and get the view to display exactly what I want in an isolated manor. So from your example there are three sections I would create isolated views for. The left menu, the top menu, and the language change section. Once you get the views functional for those it is usually simple to migrate those to an inclusion tag, if your view requires the request or request.user etc, you just need to make sure you set your inclusion tags with takes_context=True, then you can access the request via context.request. All of the examples you gave seem rather simple to implement inclusion tags, though they do tend to get much more complex if you want the various other applications to be able to create their own sections of a menu instead of maintaining it all as manually entered DB entries. To get the hang of inclusion tags it actually took me about a month and a half of playing with it and creating different ones just testing their capabilities, and asking lots of questions in #django. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~----------~----~----~----~------~----~------~--~---