So what would you like the ContactView to populate *into *the nav bar?
Without a data model, there is nothing to render.
Remember that {% include 'blog/navbar.html' %} will not access/render that
"url", it will simply paste in the contents of that file(template) into the
template before rendering (i.e. expanding tags), so the tags in that file
will be expanded based on whatever Context dict is passed to the method
which is rendering it.
But I may not be understanding the problem clearly.
On Tuesday, May 2, 2017 at 11:07:03 AM UTC-4, jithu s jacob wrote:
>
> <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 [email protected].
To post to this group, send email to [email protected].
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/1be4f422-3a3a-4ada-ae6f-cef3aa85c053%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.