1

Well I inherited a site, I have to make updates too. I have a list of news items, each news item has field I added called section, which lets people know what the section the news article blogs to. The url structure is http://example.com/tv or http://example.com/sports

On those pages, I have a list of news items (right now it's a global list) in a block. I need to adjust that list from a global list to reduce down to a list based on the section you are currently in. So the news list item should only show articles which belong to TV or Sports.

I have been working with the block, adding filters. I have attached an image of what I currently have. The field I have used in the view (sections) is called field_channel_section. In the auto preview I can put in TV and it will show me a list of the articles on that section, but on the actual page it shows nothing at all.

What am I doing wrong?

snapshot

1 Answer 1

1

Whenever you need to pass a parameter into a View, one should immediately think "Contextual Filter" - in this case, one should exist for field_channel_section. Note that blocks don't pass their parameters along the URL by default (as with pages), so you will need to set a default value for the filter criterion based on the URL yourself. Thankfully, this can be done by supplying the default value using PHP in the Contextual Filter settings. The particulars depend on what type of field field_channel_section is. If you could clarify, I'd be happy to do the same.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.