On 2/13/07, Michael Lake <[EMAIL PROTECTED]> wrote: > > Hi > > Malcolm Tredinnick wrote: > > There isn't any way to do this built into Django. It may not always make > > sense, either, since a template could just be a string (hence have no > > name). > > > > Looking through some code I have written, I found a case where I was > > doing something like you are and I am just passing in a "no_display" > > variable in the context on the pages that shouldn't have a link like > > this. I test to see if no_display is false before trying to display the > > link (in fact, in my case, it's on a help page, too). > > Thats perfect, thanks. > I now have > {% if not no_display %} > ... a help link in a div .... > {% else %} > ... a blank div element ... > {% endif %} > > and in my views for the just for the help function I have: > render-to_reponse('lab/help.html', {'no_display': 1}) > > Works a treat. Thanks.
Why not use {% block help %}... a help link in a div ....{% endblock %} in base.html, and in help.html {% block help %}{% endblock %} I think this will be simple. -- I like python! UliPad <<The Python Editor>>: http://wiki.woodpecker.org.cn/moin/UliPad My Blog: http://www.donews.net/limodou --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---