views:

45

answers:

3

I have added a new content type event. Now, i have to make a view in which it shows a set of fields if the dateOfEvent (one of the fields) is less than the present date and some other set of fields of the 'event' content if the dateOfEvent is more than the present date. how can I do that in the views..

thanks in advance for helping...

+1  A: 

Following this guide should get you where you're going: Step by Step Setup of Calendar View

alxp
+1  A: 

Are you using the Date module? It will add a bevy of new views options and make CCK date field easier to use in this manner describing exactly what you asked.

Kevin
yes i am using the date field.. but it didn't affected my views.
abhishekgupta92
Did you use the Date field filters? We use it all the time to display event listings. The view filters out events that do not have a date value >= today. But you must use a CCK 'DATE' type field or this will not work.
Kevin
Nopes. Hopefully this should solve my problem. Thanks a lot.
abhishekgupta92
problem is that this view is giving two views.. one if date value >= today and one if date value <= today.. i need to display a set of fields in each case.. so how should i get away with this thing
abhishekgupta92
+1  A: 

Hmm... I think I'd do this in the theming layer. So in views, you would make all fields available, and then in the theme, you'd hide one set or the other depending on the date value. Whether to do it with views theming, or in the node_type.tpl.php file depends on how else you're using the cck types.

sprugman
Views can filter out nodes who's date value is past a certain value. You can set a filter that says 'WHERE Date is greater than or equal to now' and it will only return events that have not expired.
Kevin
themeing will make it a little cumbersome.. can't it be done using views..
abhishekgupta92
This is not exactly what I want to say.. What I want is if the event if in future then I want to display details like venue, time, date, etc. but if the event have already happened then I want to display details like feedback, pics.
abhishekgupta92
If I'm reading you correctly, you want different fields to display depending on the data. To me, that sounds like a pretty simple if/else in a tpl file. AFAIK, there's no way to do that just within the views interface.
sprugman
yeah this should work...
abhishekgupta92

related questions