When I want to create a new calendar view using Views I have problems.
For example, if (following is the way I set up my View using Views module):

FIELDS: Node Body, Node Title
ARGUMENTS: Year, Week
SORT: (empty)

I get a monthly calendar view but with no nodes present (i.e. an empty calendar). Also, whether I click on 'Year', 'Month', 'Day' buttons I only get monthly view (which is strange since I wanted weekly view to be default)

now, when settings are:

FIELDS: Node Body, Node Title, Node Created
ARGUMENTS: Year, Week
SORT: (empty)

then I see nodes in a monthly view, but only in a monthly view, regardless if I click on 'year' or 'month' or 'day'... Also, dates are duplicated, i.e. I see 'created' date two times...

when I set my view to

FIELDS: Node Body, Node Title, Node Created
ARGUMENTS: Year, Week, Month, Day
SORT: (empty)

I don't get anything...i.e. an empty calendar with monthly view only...just like the first example...

this is so strange...
does anyone know what the issue might be? I tried disabling and enabling the modules again but it doesn't work.

Please help :)

thanks

Comments

omnyx’s picture

anyone?

thePanz’s picture

Component: User interface » Documentation

You have to add a Date field! :)

omnyx’s picture

what field? i mean, what is the exact name?
are you talking about node created time?

thePanz’s picture

In the Fields you have to choose at least one field Date.. as example Node:Date-Creation or your CCK-Date fields..

omnyx’s picture

hm...but what if I don't want it displayed at all??

but that's not the problem...I DO want it displayed...the issue is that I want to see node title, node body, and node start and end times I end up seeing those times twice, which is very strange....but if I decide not to use a date field then my nodes aren't displayed at all...

any hints? thanks for helping!

KarenS’s picture

Status: Active » Fixed

If you want a date to display on the calendar you MUST add a date field to the 'fields' section of the view. There is no other way to get the calendar to know what should be on it.

Exactly what you will see on the calendar will vary depending on what type of view you select and how you have it set up and what other fields you put in the 'fields' section of the view. If you select Node: Body as another field in the view and do nothing else, you will see the date twice, once created by the date field and once created by the way Views displays Node: Body (which is to show everything that the body shows, including the dates). Node: Teaser will also show the dates again because that is how the Node: Teaser field is set up -- to show the whole teaser with whatever is in it, including the dates.

If you want one of those fields in your view, you'll need to do some custom themeing to hide the original date field. There is a theme that creates this, theme_calendar_calendar_node(). Copy that to your theme and rename it to themename_calendar_calendar_node() and change it so it will add whatever you want to see displayed (or remove whatever should not be displayed) to $node->teaser.

Understanding that theme is not as easy as it needs to be and coming up with a more user-friendly way of doing this is on my to-do list.

omnyx’s picture

hm...thanks for getting back...
i'm still a little confused. I'm not very php savvy so it'd be great if you could give me an example piece of code of how to choose what enters the calendar view. I believe I should be able to work from there and manage to hide the duplicated dates...

thanks!

also, do you happen to know how I could create a view that shows events in a calendar view but weekly view...i didn't seem to be able to get this to work...

omnyx’s picture

I noticed that the status of the issue changed to 'fixed' which I guess is fine assuming I know how/what to do with theme_calendar_calendar_node()... which I, unfortunately, have absolutely no clue of doing...

Anonymous’s picture

Status: Fixed » Closed (fixed)