Forum Replies Created

Viewing 2 replies - 1 through 2 (of 2 total)
  • I created a few variations of a free/busy calendar, where the colors of the days change depending on the all-day events (used for displaying availability of a vacation rental). One view is tiny and contains no text (just color codes) suitable for placing in a sidebar, two views show each month in a single row (one tiny and one larger and contains text), and one “normal” calendar. On each, additional rows are added to each week for each distinct event location. This allows me to cleanly display information from one or more rental properties on the same calendar.

    Incidentally, I also tweaked the js so that a configurable number of months can be displayed at a time and they update correctly when a new month is selected from the dropdown.

    • This reply was modified 5 years, 10 months ago by cragmonkey.

    I had the same challenge, and was forced to modify ics-calendar.php to achieve it. Here what I came up with:

    // Render template
    $template_dir = $args['template_dir']??(dirname(__FILE__).'/templates/';
    switch (@$args['view']) {
         case 'list':
              include($template_dir  . 'calendar-list.php');
              break;
         case 'month':         
              include($template_dir  . 'calendar-month.php');
              break;
         default:
              $try_file = $template_dir  . 'calendar-'.$args['view'].'.php';
              if(!empty($args['view']) && file_exists($try_file)){
                   include($try_file);
              }else{
                   include($template_dir  . 'calendar-month.php');
              }
              break;
    }

    (Note that this version also allows for template directories to exist outside of the plugin’s directory so that the contents of the plugin’s directory can remain unmodified.)

Viewing 2 replies - 1 through 2 (of 2 total)