0

I have two content types: "banner wallpaper" and "banner1".

I'm using two views blocks. The view "banner wallpaper" displays the content from content type "banner wallpaper" and "banner1" the content from "banner1".

I have two wallpaper banners and two banners1 content.

With format views slideshow, timer delay set to 0 and marked random option in view I successfully managed to display the two banner wallpapers by refreshing the page. That goes same for Banner1.

My goal is: when the first wallpaper banner is displayed, the first banner from banner1 to be displayed too. When I refresh the page the second wallpaper banner and the second banner from Banner1 will be displayed, so they will be synchronized.

For an example we have two brands that will wants to advertise in the website.

Green and Orange.

These two brands wants to have wallpaper banner and flash banner. So, when Green wallpaper banner is displayed, the flash banner from Green has to be displayed too, not to be mixed with Orange. After refresh the wallpaper from Orange will be displayed and the flash banner from Orange too... I think I'm clear.

Is there any filter or sorting available to achieve this with views?

0

I would use a taxonomy to tag your content.

Create a taxonomy vocabulary (E.g.: Brand), add the two terms (Green, Orange), add a new field of "term reference" to your content types and tag the content.

Then in your views, you can add a "Contextual Filter" (in the advanced options) to get term_id from the URL, so both will show the same tagged content.

Note that I've set the Path component to be 2, that's because the term_id will be passed as 2nd argument on your URL (can be anything you want).

Don't forget to validate the value to be one from your vocabulary. That's on "WHEN THE FILTER VALUE IS IN THE URL OR A DEFAULT IS PROVIDED", check the option "Specify validation criteria" > "Validator" = Taxonomy Term > Check your vocabulary from the list.

enter image description here

Then you need to set your view URL, so you can pass the term_id by the URL:

enter image description here

By doing all that, you should be able to go to your page, type http://yoursite.com/brand/term_id and your content should appear.

| improve this answer | |
  • Hello. I've created the vocabulary with the terms, set them in the content. But I'm not sure about contextual filters how to set up. I've added the contextual filter - Content: Has taxonomy term ID in "When the filter value is NOT available" I've set to: provide default value/taxonomy term id from URL/ Load default filter from node page, that's good for related taxonomy blocks and I've selected the brand vocabulary. I've did that too on the two views, but the blocks are not displaying. I'm not sure what did I missed. – user2519032 Dec 4 '13 at 8:15
  • helllo @user2519032 I've edited my post. Hope it helps! :) – Teknotica Dec 4 '13 at 9:33
  • Thank you very much for explanation, but as I mention before I'm using blocks and I cannot set menu paths for them in Views. These two blocks are displayed in the front page. – user2519032 Dec 4 '13 at 9:56
  • You still should be able to get the parameters from the URL with a block. Set the Path Component to be 1 and by going to yourwebsite/term_id the view should filter your content – Teknotica Dec 4 '13 at 10:37

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.