On Jun 25, 9:22 pm, Alex Gaynor <alex.gay...@gmail.com> wrote: > On Thu, Jun 25, 2009 at 12:23 PM, Pete-Sitedesign < > > peter.king.sitedes...@googlemail.com> wrote: > > > I want to build a site which has latest news on the side of all the > > pages, I wanted to build the pages using simple templates (static > > content) and then reference them using the direct_to_template in the > > urls file. > > > Since each template extends base how can I get base to contain the > > latest news or do I have to write a view for each template and pass > > the news into them? > > > Sorry for the newbie question. > > There are 2 ways to do this, either a) a template context process, which > bsaically adds something to the context of all templates rendered, or b) an > inclusion tag which basically let's you do an include but with a new context > that you can create dynamically. > > Alex > > -- > "I disapprove of what you say, but I will defend to the death your right to > say it." --Voltaire > "The people's good is the highest law."--Cicero
Thanks for that. I was have just been playing with the context_processors way which is great since it provides the data to all templates. Could you explain the include idea a bit further please. Do you mean {% include some_other_template.html %} then how do I handle the URL to trigger a view to populate that included template with the content? PS Thanks for the reply. regards Pete --~--~---------~--~----~------------~-------~--~----~ 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 django-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~----------~----~----~----~------~----~------~--~---