I'm trying to set up a calendar so that the title changes depending on whether you've clicked on the month view or the day view, so I can have it say something like "Events Calendar: Month at a glance" vs. "Events Calendar: Day at a glance". It looks like setting the view title to override in the Month view or Day view should do this, but it just doesn't seem to work. It either inherits the default title or the page title (that the month and day views are attached to) or has no title at all if there aren't any default titles or page titles. Does anyone have any suggestions for making this work?
Thanks in advance!
Comments
Comment #1
deggertsen CreditAttribution: deggertsen commentedDoes this happen to be at all related to this issue? #565494: Can't Disable Event Title Links
It seems that the title field is very difficult to change...
Comment #2
biz123 CreditAttribution: biz123 commentedThanks for asking Deggertsen. My issue does not involve event titles. I'm trying to change the calendar view title based on whether it is a day view or month view of the calendar page. I still haven't had any luck. I am using the latest dev modules for calendar, views, event and date but it just doesn't seem to work properly.
Comment #3
donquixote CreditAttribution: donquixote commentedSame problem here.
The way I understand it, you should be able to change the view title in the "Calendar page" display, by putting something like "%1" in the Title field of the date argument. Unfortunately, I always get a month title, such as "December 2010", even for day and year view.
Btw, my date fields are "datestamp". I don't know if that makes any difference.
Comment #4
WiredEscape CreditAttribution: WiredEscape commentedHave same problem. Setting view titles individually and using overridden values but uses page view title for each view.
D6.16
Views 6x-2.10
Calendar 6.x-2.2
Comment #5
Kristen PolSubscribing... I also just get month & year using %1 in the title no matter what view I am in.
Kristen
Comment #6
robinmcgSubscribe
Comment #7
ManchesterNewsGuild CreditAttribution: ManchesterNewsGuild commentedSubscribing
Comment #8
siva.thanush CreditAttribution: siva.thanush commentedIs there any way to do this.
I hope the views coming from the core can be edited to override the title of the calendar title.
The week view is displaying the title as "Week of .."
I want to change it as Week's start date to End date.
Anyone knows how to do this please help.
Thank you,
Regards,
Siva
Comment #9
choster CreditAttribution: choster commentedMarked #2197859: Override the title of the calendar view as duplicate.
Comment #10
nvl.sateesh CreditAttribution: nvl.sateesh commentedIt seems an old post, but I found it just now. Just in case it helps someone.
The view title for calendar pages is actually coming from the theme.inc from date module's date_views: "modules/date/date_views/theme"
You can override it by copying the function theme_date_nav_title($params) into your template.php file and rename it to your theme name. Such as MYTHEME_date_nav_title($params){}
You can change any view's title the way you want from here.
In a nutshell, place the following code in your template.php file, change the MYTHEME to your theme name and alter the actual logic as you want.
Comment #11
humansky CreditAttribution: humansky commentedThe code in comment #10 worked for me, except I had to change the following two lines:
To this:
And it worked for me using the default formats provided.
Comment #12
kopeboy CreditAttribution: kopeboy commentedIndeed that is a bug! please fix
Even if the calendar type is set for example to "Month", the header of the calendar is now "Monday, 1 June, 2015".
After the fix, it will be "June 2015".
The correct code is
(@humansky code had a typo too, the _ must be inside the ' ' in both lines)
Comment #13
cmseasy CreditAttribution: cmseasy commentedBumped into this issue, solved it with #10 and #12.
A better place to solve this is with a patch for the calendar module.
Comment #14
Michael_Lessard_micles.biz CreditAttribution: Michael_Lessard_micles.biz commentedPersonally, I had to apply the corrected lines from #12 also under the default function theme_date_nav_title($params) {
otherwise my month default title remained "day, month 1, year" (Saturday, August 1, 2015).
One also needs to re-save the settings at: admin/config/regional/date-time/date-views
See :
https://www.drupal.org/files/issues/date-title_date_formats-2294973-70.p...
From
https://www.drupal.org/node/2294973#comment-9417959
Comment #15
nasi CreditAttribution: nasi as a volunteer commentedI thought it might be using the 'Date views day format with year' settings in Regional settings, rather than the Month views setting, as that defaults to l, F j, Y - but that's not it; changing those settings makes no difference. I, F j, Y seems to be hard wired into the module.
So does seem to be an outstanding bug that needs fixing…
Comment #16
nasi CreditAttribution: nasi as a volunteer commentedComment #17
RAWDESK CreditAttribution: RAWDESK for Colruyt Group Services commented#14 resolved my issue too.
Hence, dpm placed in my copied theme function inside template.php is not shown. So the copied function is not being called at all.
Comment #18
apaderno