Hi, It is very easy, see below: # The first argument *must* be called "context" here. def jump_link(context): return { 'link': context['home_link'], 'title': context['home_title'], } # Register the custom tag as an inclusion tag with takes_context=True. register.inclusion_tag('link.html', takes_context=True)(jump_link)
you can see more information at: http://www.djangoproject.com/documentation/templates_python/#inclusion-tags -- -- --------------------------------------- Tomás Garzón Hervás Director de Desarrollo y Calidad de Intelligent Solutions, S.L. - Teléfono Móvil: 646760508 Teléfono Fijo: 958 750 971 - Bussines & Innovation Center (BIC) Parque tecnológico de ciencias de la salud Avd. de la innovación 1 C.P. 18100 Armilla (Granada) - www.iactive.es --------------------------------------- --------- Mensaje Original -------- De: django-users@googlegroups.com Para: Django users <django-users@googlegroups.com> Asunto: Re: Handle on request object from custom tag Fecha: 10/05/08 06:27 > > > That did it -- thanks. > > On May 9, 10:41 pm, "James Bennett" <[EMAIL PROTECTED]> wrote: > > On Fri, May 9, 2008 at 10:11 PM, Greg Fuller <[EMAIL PROTECTED]> wrote: > > > How do I get a handle on the request object from within a custom > > > template tag? > > > > By making the request available to the template as a context variable, > > then accessing it the same as any other context variable. > > > > -- > > "Bureaucrat Conrad, you are technically correct -- the best kind of correct." > > > > --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---