0

I created an Events content type. I created a vocabulary that has two category terms, Events and Plays.

I have a view that contains a list of all content of type Events.

Each Events listing displays with the category term as the title/link.

The link should go to a page that has a content pane containing a list of all of the Events with that tag.

So, the view looks something like,

Movie (term)

movieName

movieTime

Play (term)

movieName

movieTime

Movie (term)

movieName

movieTime

Play (term)

movieName

movieTime

Movie (term)

movieName

movieTime

The term field is configured to be a link.

If I click on Movie or Play I want to go to a page that has a content pane containing a list of all of the Events tagged with Play or Movie, depending on which I clicked.

On the view, I set up a Contextual filter:

Content: Has taxonomy term ID

I set up a Relationship:

Content: Taxonomy terms on node

How can I set up this view so that clicking on the category will take me to another page with a view/content pane that displays a list of Events based on that tag?

0

First you will need to have the views page that displays all the Events for the tag you want, then it should be a matter to rewrite the Link field to output as a link that point to that page you had created.

FOR THE PAGE:

  1. Create the page using views that will filter all Events with category Terror
  2. In the URL make it the exact TERM you will have in the list you need, i.e. www.yourwebsite.com/TERROR
  3. Save

FOR THE LIST:

  1. Create the block/page view you need with the list
  2. You need to add the field TERM again (it should appear twice, one above the other, rearrange if not).
  3. In the first TERM FIELD check the box for Exclude from display
  4. On the second one, go to Rewrite Results > Output this field as a link, check that box
  5. In the text field that appears, enter the replacement pattern for the first TERM FIELD, something like [field_term].

That will render your TERM as a link to the TERM page, that will contain all the events for that term. If not, place a link so I can help you.

  • thank you so much for your answer, it does sound similar to what I am trying to do. Let me try to explain better: I already have a page set up with two columns. If I am looking at a view that contains a list of all Events, when I click on a term in the list of Events, I want to navigate to the page I created (or an iteration of it, based on term selection), and one of the columns should contain the view pane with the view of events of just that category. – lane Mar 6 '18 at 20:40
  • Unfortunately, I can't post a link to the site because it's in a devel space. :( Sorry! But please let me know if I can provide any clarifying information. – lane Mar 6 '18 at 20:41
  • Another way to say it is, I want the destination of any term link to be the page containing the content pane of items of that category i.e. not a page view. – lane Mar 6 '18 at 20:45
  • 1
    Correct me if I'm wrong, what you have is a Panel View in the first column you have the list of terms and in the second one you want to display all the events (content) for the selected category/term you select? – Thremulant Mar 7 '18 at 0:47
  • 1
    Hi @lcunning almost there! I was able to have a list of terms in the left (movies, plays, etc.) and when you click one of them, the content in the right will filter to the nodes that have the category you selected. But I couldn't find any way to do this while displaying also the nodes below the term. I added a case for this in the module I was using Views Global Filter 'cause I don't see any option to do it beside manually creating a PHP widget, something I don't know how to do. This is the case: link – Thremulant Mar 8 '18 at 3:00
0

There are two scenarios here:

1 If your terms were exclusive to the events content type: Then you just make the terms linked -- they should provide what you need... it would display a list of content tagged with move or play. You then don't need to set up the contextual filter.

2 If your terms were NOT exclusive to the Event content type: Then you would need to need to change the link of the taxonomy term to point to a views page with the Contextual filter (it can be the same views page or a different one). The easiest way to do that is to just use the tag ID.

You'd make the taxonomy term in the views fields output as plain text, and then use "Output this field as a link" under "rewrite results" to make it link to "your-view-path/[field_tags-tid]"

Your title on the page can be Events %1 and that should change as well when the user clicks on a movie or plays.

I don't think you need the relationship here in either case.

  • thanks for your answer! What you describe is sort of like what I have set up. I have the view set up so that the terms are links, and they go to a view of all content in that category. My issue is that I want that page to be a pane so that I can add an additional panel beside it. – lane Mar 6 '18 at 20:32
  • I should add, I already have a page set up with two columns. When I click on any term in the list of Events, I want to navigate to this page (or an iteration of it, based on term selection), and one of the columns should contain the view pane with the view of events of just that category. – lane Mar 6 '18 at 20:35
  • Another way to say it is, I want the destination of any term link to be the page containing the content pane of items of that category i.e. not a page view. – lane Mar 6 '18 at 20:51
  • Wouldn't it be easier to add the panel of additional content onto the view page than the other way around? What is the other content? And when you say panels, do you mean the panels module? You can have a block do the same thing as I write above. Your original list would just be pointing to that other page. The block (embedded in a pane) can still pick up info from the url but has to have a default value. – Adrained Mar 6 '18 at 22:27

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.