Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Hey,
This more a question how to use date arguments.
I have created a Content type "Games" with CCK and a view to display this data.
date: select list (dd/mm/yyyy hh:ss)
hometeam: text field
visitors: text field
I can list the games of this week using this syntax ?q=games/@P1W . This works like a charm but what would the syntax be to list the games of next week ? And what would be the syntax to list the games of the previous week ?
Thanks
Comment | File | Size | Author |
---|---|---|---|
#2 | photoshop_week_paging.jpg | 128.54 KB | tmp |
Comments
Comment #1
KarenS CreditAttribution: KarenS commentedI just committed something to the cvs version you might try. It adds a date browser plugin that works in combination with the date range argument. You create a view that uses the date range argument and give the argument an option of the period you want to page by (year, month, week, day, or hour), then select Date: Date Browser for your page type (instead of table or list). Then when you go to your view it will default to the current period that you selected and provide back/next links to the next and previous period. You may need to clear your cache to get it working.
That's not exactly what you asked, but maybe what you want???
Comment #2
tmp CreditAttribution: tmp commentedHey Karen,
Thanks again for these new features.
Would it be possible to make something like the screenshot in attachment ? The pager would always be on top of the view and would alow easy scrolling by year, month or week, ... depending on the argument settings.
It's just a thought :-)
Comment #3
tmp CreditAttribution: tmp commentedHey karen,
This is what I need for a date browser BUT in my case I need to display the games-nodes in a table view.
Cheers
Comment #4
KarenS CreditAttribution: KarenS commentedThe display is themeable. Look at the bottom of date_views.inc and you'll see a theme called theme_date_views_browser_full_view(). Copy that function to your template.php file in your theme and rename it to mytheme_browser_full_view(). Then where it says $display='views_view_teasers' change it to say 'views_view_table';
Comment #5
KarenS CreditAttribution: KarenS commentedI mean rename it to mytheme_views_browser_full_view(). (Replace 'date' with your theme name).
Comment #6
KarenS CreditAttribution: KarenS commentedI still got it wrong. I mean rename 'theme' with your theme name. :-)
I'm marking this as fixed, reopen if necessary.
Comment #7
tmp CreditAttribution: tmp commentedHey Karen,
I pasted this piece of code in the template.php. This will display the date brower in table format.
Thanks
Comment #8
tmp CreditAttribution: tmp commentedHey Karen,
When the date browser is opened, I would like to display to current week by default.
?games/@P1W doesn't seem to work with the datebrowser to display the current week.
Comment #9
KarenS CreditAttribution: KarenS commentedThe date browser displays the current week (or year or month or day or hour) when you have nothing in the argument. Any reason why you don't want to leave the argument blank?
Comment #10
tmp CreditAttribution: tmp commentedHey Karen,
Leaving the argument blank doesn't seem to work. This displays all nodes.
Comment #11
KarenS CreditAttribution: KarenS commentedDo you have the Date:Date Browser type selected for the page view? If so, please export your view and paste it here. That ought to be working...
Comment #12
tmp CreditAttribution: tmp commentedKaren,
The view is set to datebrowser.
This is the export:
Comment #13
KarenS CreditAttribution: KarenS commentedI was just about to tell you I couldn't replicate this when I finally got something set up that behaves this way. I'm working on it...
Comment #14
KarenS CreditAttribution: KarenS commentedI just made changes to both cvs and 4.7 version. I think that will fix the problems.
Comment #15
tmp CreditAttribution: tmp commentedI had a quick look at it. It looks fine.
Comment #16
(not verified) CreditAttribution: commented