Outputting all articles with a specific label
We have the labels listed as a sub-nav in the form of categories. When we click on a label, how do we show all blog articles assigned to that category?
Comments are currently closed for this discussion. You can start a new one.
2 Posted by John Nunemaker on 23 Mar, 2010 02:48 AM
You can loop through the posts variable that automatically gets injected into the template.
John Nunemaker closed this discussion on 23 Mar, 2010 02:48 AM.
darryn soper re-opened this discussion on 23 Mar, 2010 03:09 AM
3 Posted by darryn soper on 23 Mar, 2010 03:09 AM
How does this limit it to specific labels?
4 Posted by Galen King on 23 Mar, 2010 03:12 AM
Hi John,
That was actually me posting those queries at Darryn's desk.
What we want to do is something like this (semi-pseudo code):
Cheers,
Galen
5 Posted by John Nunemaker on 23 Mar, 2010 03:20 AM
Yes, if you are viewing a label, ie: blog/labels/foo then posts is a
variable that is automatically injected in. It is only the posts that have
that label. Did you try the snippet? If you have blog.label template and
that is assigned to each label, posts is automatically made available for
you.
We need to document this a bit better. Does this answer you question?
6 Posted by Galen King on 23 Mar, 2010 03:40 AM
#resolve
Yes, perfect. Thanks.
Galen
Sent from my iPhone
John Nunemaker closed this discussion on 11 May, 2010 04:51 PM.