Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

drupal calendar

Posted on 2010-08-18
12
Medium Priority
?
1,009 Views
Last Modified: 2012-06-27
in the drupal calendar block view, the mini calendar, is there a way to make the Month not clickable? I want to hide the month view and year view and week view.

and i installed the date-picker and enable anything but it's not working, where's the date picker supposed to show up?
0
Comment
Question by:charmingduck
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 7
  • 5
12 Comments
 
LVL 17

Expert Comment

by:Thomas4019
ID: 33469011
You can hide the other views using CSS.
0
 

Author Comment

by:charmingduck
ID: 33469384
I know, but you are not answering my question,


in the drupal calendar block view, the mini calendar, is there a way to make the Month not clickable?
0
 
LVL 17

Assisted Solution

by:Thomas4019
Thomas4019 earned 500 total points
ID: 33469721
ok, i see what you're asking now.

Using the theme developer module, https://drupal.org/project/devel_themer, I was able to get that the function that creates the title is theme_date_nav_title, http://drupalcontrib.org/api/function/theme_date_nav_title.

Here's how you could remove the link.

1. Navigate to your theme's folder.
2. Open up page.tpl.php
3. Add in the following code snippet, replacing the YOURTHEMENAME in the function title, with your themes machine name. For example if you are using the garland theme use this name for the function, garland_date_nav_title
<?php
function YOURTHEMENAME_date_nav_title($granularity, $view, $link = FALSE, $format = NULL) {
  switch ($granularity) {
    case 'year':
      $title = $view->date_info->year;
      $url = $view->date_info->url .'/'. $view->date_info->year;
      break;
    case 'month':
      $format = !empty($format) ? $format : (empty($view->date_info->mini) ? 'F Y' : 'F');
      $title = date_format_date($view->date_info->min_date, 'custom', $format);
      $url = $view->date_info->url .'/'. $view->date_info->year .'-'. date_pad($view->date_info->month);
      break;
    case 'day':
      $format = !empty($format) ? $format : (empty($view->date_info->mini) ? 'l, F j Y' : 'l, F j');
      $title = date_format_date($view->date_info->min_date, 'custom', $format);
      $url = $view->date_info->url .'/'. $view->date_info->year .'-'. date_pad($view->date_info->month) .'-'. date_pad($view->date_info->day);
      break;
    case 'week':
    	$format = !empty($format) ? $format : (empty($view->date_info->mini) ? 'F j Y' : 'F j');
      $title = t('Week of @date', array('@date' => date_format_date($view->date_info->min_date, 'custom', $format)));
    	$url = $view->date_info->url .'/'. $view->date_info->year .'-W'. date_pad($view->date_info->week);
    	break;
  }
  
  return $title;
}
?>

Open in new window

0
Enroll in October's Free Course of the Month

Do you work with and analyze data? Enroll in October's Course of the Month for 7+ hours of SQL training, allowing you to quickly and efficiently store or retrieve data. It's free for Premium Members, Team Accounts, and Qualified Experts!

 
LVL 17

Expert Comment

by:Thomas4019
ID: 33469728
Oops, make sure to delete the "<?php" and "?>" from the code snippet above before copying into the page.tpl.php file
0
 

Author Comment

by:charmingduck
ID: 33470029
thanks, I tried and it didnt work, did i do something wrong?
0
 
LVL 17

Expert Comment

by:Thomas4019
ID: 33470514
did you flush your caches after putting in the function if not then please do.

The admin menu module makes it easy to flush your caches, http://drupal.org/project/admin_menu. Just hover over the top-left icon and then click "flush all caches"

what theme are you using?
0
 

Author Comment

by:charmingduck
ID: 33470889
I'm using fusion core


so it would be    fusion_core__date_nav_title   ?


I tried again, didn't work...
0
 
LVL 17

Expert Comment

by:Thomas4019
ID: 33470933
I think it would be fusion_core_date_nav_title. The prefix should be the same as the folder name of your theme.

Also, follow this guide, http://www.kristen.org/content/how-get-drupal-theme-change-show.
0
 

Author Comment

by:charmingduck
ID: 33471018
yeah, that's what i did. But no luck,,, Did it work for you?
0
 
LVL 17

Accepted Solution

by:
Thomas4019 earned 500 total points
ID: 33471059
Ahh, it's working on my end.

The function needs to go in your themes template.tpl.php and not your page.tpl.php. Sorry about that mistake.
0
 

Author Comment

by:charmingduck
ID: 33471151
awesome, great!!!

Hey Thomas4019,

If you have time, I'm going to post another question on applying ajax to the mini calendar, I know there's a lot of discussion about that and I dont really see the solution. If you know how to do that, would you leave me something?

Many thanks.  
0
 
LVL 17

Expert Comment

by:Thomas4019
ID: 33471161
Glad to help!

I'll try my best with adding ajax to the mini calendar. I don't know if there's an easy solution but everything's possible.
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article is for those that are having major problems with users upload files such as pictures to their profile. The solution is simple and has to do with correcting the directory paths. With some experimenting and testing i got it fixed. Note…
RTL (right to left) web applications aiming for audiences speaking languages like Hebrew or Arabic, are generally more complicated than the same applications aiming for audiences speaking Latin based languages. The main difference lies of course …
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…
Suggested Courses

609 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question