<div class="container-fluid">
  <div class="row content">
    {% include 'blog/navbar.html' %}

    <div class="col-sm-9">
      <h4><small>RECENT POSTS</small></h4>
      <hr>
      {%block content %}
      {% endblock%}
                
    </div>
  </div>
</div>

class HomeView(ListView):
template_name='blog/home.html'
model=Blog

class BlogView(DetailView):
template_name='blog/blog.html'
model=Blog


class ContactView(ListView):         --------> i don't need model blog for 
contactview.But I am using it to populate side navbar.If I have other 
similar                                                                     
                   views.should it done in the same way
template_name='blog/contact.html'
model=Blog



On Monday, May 1, 2017 at 4:50:37 PM UTC+5:30, jithu s jacob wrote:
>
> I am using parent template as base which has a side nav bar. the child 
> template keeps changing with clicking of buttons.
>  
> My child template changes correctly with call to different views through 
> the URLs.
>
> Now I want to add some data from model i the parent template irrespective 
> of the view/model  or URL being called in the child template.
>
> is there any easy was to do this.
>
> for now I am writing additional context variables for parent template for 
> all the child views. But this is not feasible
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/ed482367-15ae-47f8-89ce-f38de7a9261b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to