Month navigation sidebar in blog section? - drupal

I have a blog section in a drupal website, built with Views. I want to add a sidebar with month navigation (as in each mont is listed with the number of posts, etc). How can I do this, preferably with Views?

Drupal views can create views which allow you to select and list or summarise lists of nodes by various fields including the date related fields. You can do this by adding an argument, and then setting how the view behaves when no argument is supplied.
Are you looking for something along the following lines?
March 2010 (3)
February 2010 (12)
January 2010 (7)
... etc.
Create a view called Monthly Summary, and add an "argument" 'Node: Created year + month'.
Then use the options on the argument to select the 'action to take if argument is not present'. Select 'Summary, sorted descending' to create list with most recent month at top.
Watch out for sorting issues - this choice of how you sort the monthly summary in the argument settings will override the usual views sort order. This caught me out for a while.

Have you tried the Date/Calendar modules? Some more details about the Calendar module (from its project page):
This module will display any Views date field in calendar formats, including CCK date fields, node created or updated dates, etc. Switch between year, month, and day views. Back and next navigation is provided for all views. Lots of the Calendar functionality comes from the Date module, so any time you update the Calendar module you should be sure you also update to the latest version of the Date module at the same time.
See also Date iCal, a project that contains code and features needed to either import or export dates using iCal feeds. The functionality that used to be in the Calendar iCal module has been moved into that module.

Related

Showing count of content based on the select list values Drupal 7

I have a requirement in which I need to show some content along with its count based on values in a select list. I wanted to display the allocated,released and resigned resources of a particular department in a selected date range. Using views, date range and department fields are created as exposed filters.
Created a content type for creating resources. The Resources content type is having action as a select list with values allocated,released,resigned. Department is another select list and date field is also added.
Please help me with an answer if views module is not enough. Provide some other solutions also. I'm using Drupal 7.
I figured out how to show node count in views. In my view I’ve some exposed filters and passed my select list cck field as contextual filter. If no result available I made the view to display summary as row count. In the template file, I’m planning to do some calculations for showing the resources count in and out of the project. Please correct me if there is anything wrong in this approach.

create date formatted custom_meta field in wordpress admin

I have created a custom meta field to be used within a custom post type, that is to be the start time of a series of events. However, I would like to run my query_posts off of this value, but it is not formatted in date/time format, therefore '1:00pm' shows up in the list before '9:00am'. Is it possible to format this value in the db or at least prior to setting the 'meta_key' meta_value in my arguments for my query?
I've come across this problem a few times before. I'm going to use my most recent example because it sounds like it's along the same lines of what you're doing.
I had to create an event calendar using WordPress. In my custom post type, I had two fields: a start time and an end time. Instead of just using "1:00pm" as the start and end times, I also included the dates. This would allow for events that would last an entire weekend like a concert or a race.
What I'm getting at here, is once the user submitted that the event started on January 3, 2012 at 8:00 am and ended on January 3, 2012 at 10:00 am, I saved both of the variables using strtotime(). If you're not familiar with this function, you can read more about it here: http://us.php.net/manual/en/function.strtotime.php.
I also suggest using the datetime picker add-on for jQuery UI http://trentrichardson.com/examples/timepicker/.
I hope this helped. I know I was a little vague at times. If you need me to explain anything in more detail, don't be afraid to ask.

Change the input method in plone event forms?

I am trying do one of the following in the "Create Event" form in Plone 4, when creating events which happened in the past:
i. Set the default start/end dates in the "Start Date" and "End Date" drop-downs to a larger range of values (I cannot create events before 2001 or after 2016).
OR
ii. Allow users to input start/end dates for events as text (rather than select from a drop-down).
I can't seem to find what is controlling this form anywhere... after hours of googling!
The start and end fields are standard Archetypes DateTimeField fields, using the default CalendarWidget widgets.
The CalendarWidget reuses some fairly old and crufty calendar macros from Plone, and these read the range of selectable years from the site properties. You can change these in the ZMI, find the portal_properties tool, then the site_properties property sheet within that. The two properties to look for are:
calendar_starting_year
The starting year to show in the calendar widget. Default is 2001.
calendar_future_years_available
The number of future years, after the current year, to show in the calendar widget. Default is empty, and the widget then falls back to 5 years.
Also see the site properties documentation; you can also use a GenericSetup profile to set these.
These values apply to all usage of the calendar macros. You can also set this for just the event type, by setting the starting_year, ending_year and/or future_years properties on the CalendarWidget for the startDate and endDate fields. If you set an ending_year the future_years property is ignored.
Monkey-patch style altering of the event schema:
from Products.Archetypes.content import event
ATEventSchema['startDate'].widget.starting_year = 1999
ATEventSchema['startDate'].widget.ending_year = 2020
ATEventSchema['endDate'].widget.starting_year = 1999
ATEventSchema['endDate'].widget.ending_year = 2020
If the starting_year and ending_year are not defined on the definition level of the calendarwidget (inside the definition of the ATEvent schema implementation) then some assumptions about the year range is made inside
Products/CMFPlone/skins/plone_scripts/date_components_support.py
Modify the related code inside the date_components_support.py script.

food-menu problem in drupal

I am trying to create a food menu for a boarding school. The idea is to let the students view what they have on menu for the whole day. That is, breakfast, lunch and dinner. This menu would be prepopulated weekly by a user.
My problem are as follows:
1) How do i use view module to just display items for one day?
2) Do i need like a date field, and calender module?
I would recommend using the Date module.
Add a date field to your 'boardingschoolmenu' content type.
Then in views you would add the fields you want visible (breakfast, lunch, dinner, etc)
Add a filter on content type 'boardingschoolmenu'
Add an argument for the date field. In the settings of the argument, under "Action to take if argument is not present", select: Provide default argument followed by: Current date (or can use php code if you want another date).

Select date fields for only 6 months beginning with current in Drupal Views

I have a content type with a date field which can have multiple values.
How can i select the dates in Views for each month separately, beginning with the current month and have table columns titled with the month names?
Views can filter the appropriate nodes easily enough using "filters" and "sort criteria" in the views UI.
But, you probably won't be able to get a table-based view of the nodes in table form without developing a custom module or theme function to render the table HTML. There's really no easy way (that I know of) to turn a specialized query into an HTML table without digging into PHP and iterating through query results.
More info on developing modules is at http://drupal.org/node/508
And is it posible to do it by selecting the date field six times and passing six arguments?

Resources