Hi all,
I'm trying to make a list of events. Some events last for one day while othere have a start date and end date. I need 3 different lists: Past, current and future dates.
I solve this to make 3 different blocks and show it at one page only in the content bottom. I feel that there must be a more efficient way. Any suggestions are welcome.
But my main problem is the following: I've set the cck date field up so that the End Date is optional. But if i leave the end date empty, it will set the End Date automaticly the same as the start date. Which is no problem if i could leave the End Date off in views if it is the same as the Start Date. But i feel my problem needs to be solved in the very beginning with the cck-fields. I could make 2 different content types: one for one-day events and another for events with a large timespan. But this doesn't look like a good idea.
Any suggestion is very welcome.
Thanks in advance,
Danny
Comments
_
if i understand you correctly, i believe you'll need to theme the end date field to include the logic of "if start date != end date then print end date".
This might be correct. Too
This might be correct. Too bad that i need to theme my entire views page, just to change one option.
If this is true, it seems that i will need to theme my views pages whenever i use single dates and starting- and enddates in the same list. I will check out the options for this theming-wise, but deep inside i was still hoping for a more elegant sollution, i guess... :)
Thank you very much for your help, WordFallz...
Btw: do you think that the 3 blocks thing is a good idea?
_
I know you can select a template that only themes that one field and you can select a template that applies to all views-- I'm just not sure if you can select a template that themes one field across all views. If not, I would probably just use the field template and copy it anytime you want to theme a field that way.
I find views theming pretty elegant-- but if by 'elegant' you mean 'without code' then yeah, I guess it's not. ;-)
I like the idea of the blocks, I'm not so sure about leaving the date field blank-- there must be a better way of handling that, I just can't think of it at the moment.
It works! I made a file
It works! I made a file called:
With this content:
I feel like i made a few very lucky guesses, because the documentation looks like a maze for me. I just guessed that if i used print_r($row) i could find a clue on what to extract.
I'm actually more focussed on graphical designing, but to build websites Drupal looks like the best and easiest platform to build my websites on. You can understand that a stuff like "$row->node_data_field_date_field_date_value2" does not look elegant viewed trough a graphical designers eye... ;) Nonetheless, i love the Drupal project and its community sooo much... :)
_
lolol, yeah when you put it that way, i guess it's not elegant. ;-)
glad you got what you needed!
Hmm, I have a new problem
Hmm, I have a new problem already that I cant seem to fix in the theming at first sight. I want to make a list of all ongoing events. That means all events with the same date as 'now', but more important: all events with the Start Date smaller and the End Date larger than 'now'.
http://drupal.org/node/505746
_
I don't have time to play around with this right now, but I would think you could do this by adding two filters-- one for 'start date' >= now or today and then another for 'end date' is <= now/today.
Omg, I can't believe how
Omg, I can't believe how obvious that was. I thought about so many options, but not the most logic one.
I think I've said this before, but you rule, WordFallz... :)
_
Sometimes the most obvious solution is also the most easily overlooked-- i've had it happen myself plenty of times, lol.
and thanks for the kind words-- happy to help ;-)