Skip to main content

a View to display pictures from a forum topic - thought i had it.

2 replies [Last post]
User offline. Last seen 6 weeks 11 hours ago. Offline
Joined: 01/26/2010
Posts:
Points: 0

i thought i had a View set up which displayed only the pictures loaded into a forum thread for the purpose of reorganizing the way forum threads are displayed.

 

however, the view is actually aggregating all images in all forums.  not what i had planned.

 

it probably has to do with FILTERS in views, but i have yet to get filters to work as i think they should.

 

so here's what i need:  a view which will display the pictures found only in a forum post (certain node ID i would assume)

 

i can't seem to figure out how to filter the criteria to suit this need.  filters for me only brings up operators which are related to the names of my forums.  there is no option to enter node ID's or anything else.  i am sure it's very logical, but as of yet filters are still quite peculiar to me.

0
Your rating: None
User offline. Last seen 1 week 4 days ago. Offline
Joined: 01/24/2010
Posts:
Points: 0
Groups: Developers
You want contextual filters

Filters are either hard coded or entered by the user. This means no matter where your view is displayed, the filter will always be the same.

What you want is to pass in a Node ID which is different depending on what page you're looking at. This is what contextual filters are for. If you open the advanced setting of your view you'll see Contextual Filters. Click add next to it and you see one for "Content: Nid". Add "Content: nid" and configure it like this

 

Make sure you delete any regular filters you don't need anymore. Probably only need Published = true.

User offline. Last seen 6 weeks 11 hours ago. Offline
Joined: 01/26/2010
Posts:
Points: 0
wow, contextual filters was

wow, contextual filters was just what i needed, batt!  of all the youtube videos i watched about views and really anything related to drupal, i wasn't taught about contextual filters.

 

i'm really loving drupal again.  i wouldn't be able to get the kind of site i am putting together any easier.  it's great once everything you want to accomplish comes togehether with drupal.