Hello,

I've been working a little with views, and with the calendar module, that works as an special view.

Working with "Calendar" module, and looking at all parameters you can manage in view configuration you can also configure a "Criterion filter" for choosing the default value to write the calendar, and between the options menu exists the "PHP Code".

I'm trying to know how to use this box. Is there any example I can see? I didn't fint it....

What should be the code I have to use here to say "I want to filter by the date of the content X"?

Thanks!

Comments

nevets’s picture

Re: What should be the code I have to use here to say "I want to filter by the date of the content X"?

This is a setting in the contextual filter (one of the last settings).

AbelT’s picture

uuuppps! I didn't explain it very well...

Yes, it is one of the last settings, the "current date", the "current node's creation date" and the "current node's update date", but I want to filter through a different field, one I created in the content type event called "field_event_start".... and I don't know how to fix it...

Thanks!

nevets’s picture

If field_event_start is a date field it should show in the list

AbelT’s picture

Yes, it should be in the list, but it doesn't.
The elements shown in the list are:

Content ID from URL,
Fixed value,
PHP Code,
Raw value from URL,
Taxonomy term ID from URL,
User ID from URL,
User ID from logged in user,
Current date,
Current node's creation time,
Current node's update time

So that is the reason I thought I could use the "PHP Code" to use the field_event_start, but I don't know how...

thanks!