On 11/16/06, Martin <[EMAIL PROTECTED]> wrote: > not every news item has the video. what to do in those cases? i > probably have to do something like "if there is a video, insert html > code for it" - but how do i do that in a template?
Make it a field on the new item class, call it maybe 'video_url', and make it optional (use 'blank=True, null=True'). Then in the template: {% if news_item.video_url %} <a href="{{ news_item.video_url }}">Click here for video</a> {% endif %} -- "May the forces of evil become confused on the way to your house." -- George Carlin --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---