0

I have a page for the Calendar module on my site. Below the calendar, I have a table view that displays links based on taxonomy terms that correspond to the year-month format of the calendar module URL arguments (which change when the user changes the calendar month). I'm new to Drupal and can't figure out how to filter these results based on whether or not the content term matches the URL arg from calendar. Do I use contextual filters? Thanks for the help.

edit: I should mention I am using Drupal 7.

1

I am not exactly sure what you mean. Could your provide an example of what the URL looks like? Off the top of my head I think that you would just want to use view arguments.

| improve this answer | |
  • Yeah, sorry. When the user changes the calendar month, the URL changes to something like [my sites name]/calendar_test/2012-08. I have a whole bunch of "Events" stored as Content, which are displayed in the Calendar module. I also have some "Events" that aren't displayed in the calendar, but rather in a table below showing the title of the event and a link. Each of these events that aren't in the calendar have a tag that matches the URL arg (eg. 2012-08). I want to make it so that when I click to change the month, the table of events checks to see if each event has a tag matching the URL arg. – user8733 Jul 18 '12 at 21:58
  • Are all of the event types the same content type? How are the two different events differentiated? Are they different content types? Is there a "visible" check box somewhere? I think that having the date in that format might make it a bit tough to do and would involve PHP that could get complicated. Could you use the content creation kit module and add a date field to the calendar items reserved for the tables below? That way you can use standard views filters to create the tables. – fry.pan Jul 19 '12 at 1:00
0

You could accomplish this with a PHP filter on the view. Make sure to add Content:nid as a field in the view, set to exclude from display. First load the node info and see what it contains by using dpm():

<?php
$node = node_load($row->nid);
dpm($node);
?>

You should then be able to access the node's taxonomy term with:

$term = $node-> Something Here From dpm();

From here you could compare $term to arg(1) and return FALSE if they match.

| improve this answer | |

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.