Hi All

I want to set up a views view with a calendar module
there must be three arguments year/month/day
i want to add term id argument but i want it to be the first one, is that possible ?
i have managed to set it as the fourth arguments and it worked fine, but when i have moved it as the first argument this does not work, any ideas ?

Avior

Comments

z.stolar’s picture

What are the results you DO get?
How do you define the argument's default behavior?

======================
Z.Stolar
linnovate.net - community content infrastructures

avior’s picture

i want to be able to use the url without the parameters for the current month
i have set (also) the term id argument to "show all values"

so if the view url is "events"
if i use example.com/events - i get an all the values but i get warning messages

# warning: Invalid argument supplied for foreach() in pathhere\includes\tablesort.inc on line 149.
# warning: Invalid argument supplied for foreach() in pathhere\includes\tablesort.inc on line 187.
# warning: Invalid argument supplied for foreach() in pathhere\includes\theme.inc on line 769

if i send "all"
example.com/events/all or example.com/events/TERMID
I get an empty content

if i use the full url with a term id it works
example.com/events/12/2007/08/all

any ideas ?

Dev Art- Drupal Based Services and development

z.stolar’s picture

In addition to the default value, there is also the wildcard variable.
You should put your tid as first argument, and give it a wildcard of "all".
Does it work?

avior’s picture

I have tried to do this before - i get the warning messages as above (and then i don't have the prev / next months)

I have also tried to setup a code in the arguments -

// set the first argument  if not already set
if (!$args[0]) {
  $args[0] = 'all'; // or 12 does not matter
}
return $args;

then i got an empty content

Dev Art- Drupal Based Services and development

thepanz’s picture

Seems also that if you put your 4th argument at the end of Arguments, in Day-view Prev and next get wrongs links..

i setup my view ("lessons") that way

Arg1: year
Arg2: month
Arg3: day
Arg4: OG-gid

If I write "?q=lessons/2007/09/03/MYGID" I get all events for that day, in that course, but Prev and Next points to wong path : Next points to "?q=lessons/MYGID/2007/09/04"..

Is there a wrong link creation?

-thePanz-

-thePanz-

thepanz’s picture

Same results here.. maybe it's a module's bug?
Seem that there is something wrong with arguments handling..

hope to hear good news for solutions...

-thePanz-

-thePanz-

will_in_wi’s picture

I have the exact same problem. Any Ideas?

avior’s picture

Hi
I couldn't find solution for this , i worked around it ...

I added a filter to the view with termid and set it to my default value
and every time i need the view i added a node with php code to take the view , set the filter to a new value and print the view , here is the code sample :

<?php 
// update this with the  term id 
$view_term_id = 17;
  
$view = views_load_view("news");      // write your view name here 
$view->filter[0]['value'] = array($view_term_id);
$view->is_cacheable = 0;

print views_build_view('embed', $view, array(), false);

?>

I am using drupal 5.2, views 5.x-1.6
hope this helps

Dev Art- Drupal Based Services and development

karens’s picture

This was something that used to work and got broken as the Calendar acquired more features. I just committed a fix to the dev version of the module that should make it possible to use a non-calendar argument in front of calendar arguments, which will let you dynamically filter the calendar by whatever that argument is.