Hey Guys,

So I am making some sort of coupon website. And I strugle to get my views right...

This is what I did so far:

I made a panel layout for content style so every brand or product I add, is immediatly setup correctly.

So I have 100 products at this moment and I want to automate the views part so I dont have to create a seperate view to list the coupons on the right side of my webpage. How can I do this?

The views need to be filtered per brand/product and I want to show them on my panel main page and on every other couponcode targeting that brand.

I tried to use a custom code and insert it, which works but I cannot aply any sort of filter on it!

Thanks so much!!!

Roman

Comments

spovlot’s picture

You need to create a few Views that use contextual filters so that you can pass in arguments. Since you are using Panels, you can use the Panels context to pass in the coupon node id or whatever else you need. You can also use the "content pane" display in Views to make integrating with Panels easier.

You can learn about Contextual Filters starting with http://nodeone.se/en/learn-views-with-nodeone-part-19-contextual-filters... . There are a series of video tutorials on Views at http://nodeone.se/en/taming-the-beast-learn-views-with-nodeone.

Also check out http://nodeone.se/en/learn-page-manager-part-5-views-content-panes-basics .

romantjuh’s picture

Thanks for the reply!

I am using the panels context to pass the info through and it works almost. It does display the coupons but it displays all of them so also coupons which are for example related to drupal, but its displaying wordpress as well.

I got this by adding an argument input in content pane, but I think I am missing something. I used an taxonamy field which I use only for specific brand and in the panel it has selected the right brand "drupal" but still showing all brands not just drupal.... Tried a lott of things. Hmmmm

spovlot’s picture

Your view needs to have a contextual filter. In your case, you probably need to add a contextual filter on your taxonomy field.

If you still have problems, maybe you can post a screenshot of your View configuration.

romantjuh’s picture

Still running into problems! I attached some screenshots!! and realy realy thanks a lott for taking some time!

Watched the tutorial on your site about content panes as well. but its not covering realy what I need, or I did it wrong!

pic1

pic2

pic3

Thanks again!

spovlot’s picture

What is your field_link_cat_url? Is that a URL? I would expect that you would use a taxonomy field or something similar.

Also, if you are not familiar with Views, I would suggest viewing the entire tutorial series at http://nodeone.se/en/taming-the-beast-learn-views-with-nodeone

romantjuh’s picture

FIeld link cat is a taxonomy field which I use for 1 node type. I will look into that tutorial!

spovlot’s picture

OK. If that naming structure makes sense to you, then that is fine.

After looking at the screenshots again, I notice that the validation is probably wrong. The validation in pic3 shows that it validating the contextual filter as a Content which should be a Panel or "Add Product / Brand". If the filter is a taxonomy field, then you should validate it as a "Taxonomy term". Otherwise, the view will do what is specified as "Action to take if filter value does not validate".