On Tuesday, 16 December 2014 19:27:41 UTC, Andrew Nguyen wrote:
>
> I'm having some problems getting some of my content to appear on my 
> detailed page view, which I have in two separate html files that are being 
> pulled in using {% include %}. Inside my two files, slider.htmland 
> sidebar.html, I'm using tags like {{article.title}} to grab specific 
> information I need about an article. 
>

But your code shows that you are doing something completely different: 
you're not grabbing specific information about the article in question, 
you're trying to get details for *all* articles and iterate through them. 
Your detail view presumably doesn't passs any reference called 
`object_list`, so your loop doesn't work. Passing in parameters to include 
won't help, because you don't have the information in the first place.

What you really need here is a custom inclusion tag 
(https://docs.djangoproject.com/en/1.7/howto/custom-template-tags/#inclusion-tags)
 
which queries the object_list and passes it to the sidebar template for 
rendering.

--
DR.

-- 
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 http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/63cdb829-9b12-4924-9d7e-cda6dadeb866%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to