Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions craft-calendar/headless/graphql.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,12 @@ Calendar supports querying calendars and events via GraphQL. This guide assumes

Calendar has a root `solspace_calendar` query, which contains all the possible queries nested inside it to avoid conflicts with other plugins.

:::warning Upcoming Calendar 6 change

The legacy `solspace_calendar` GraphQL wrapper will be deprecated in Calendar 6. These v5 queries will continue to work in Calendar 5, but plan to update headless implementations to use the top-level Calendar GraphQL queries after upgrading.

:::

## Querying multiple Calendars

To query all or some calendars, you have to use the `calendars` query:
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"label": "Calendars",
"position": 6
}
25 changes: 25 additions & 0 deletions craft-calendar_versioned_docs/version-v6/calendars/fieldtype.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
---
sidebar_position: 2
title: Element Field Type
description: Use the Calendar Events Field Type to relate events to other elements in Craft CMS.
---

# Element Field Type

The Calendar Calendars field type allows you to assign/relate whole calendars (ID's) to other element types such as Craft Entries. What actually is related is the calendar ID, thus allowing you to then pull in events for the given calendar attached to the Craft element.

### Creating a Calendars field

Creating a Calendar Calendars field is done just like any other fieldtype, here's an overview of the process:

1. Go to the **Settings** area in Craft control panel. Click on **Fields**.
2. Click the **New field** button in the top right corner.
3. Name the field as you wish. For example: _Related Calendars_ with a handle of _relatedCalendars_.
4. For the **Field Type** option, select _Calendar Calendars_ from the list.
5. Click the **Save** button in the top right corner to save the new field.

Your Calendar Calendars field is now available to be assigned to other sections.

### How the Fieldtype works

The Calendar Calendars fieldtype lets the user choose 1 calendar to assign to any element: a section entry, categories, assets, etc.
89 changes: 89 additions & 0 deletions craft-calendar_versioned_docs/version-v6/calendars/index.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
---
title: Managing Calendar
description: Overview of calendars, events, and management features in Solspace Calendar 6.x for Craft CMS.
---

import { Photo, Badge } from '@site/src/components/utils';

# Managing Calendars

Calendar allows you to group your events into calendars, very similar to popular calendaring apps like _Apple Calendar_ and _Google Calendar_. Calendars can be customized to have their own fields / field layouts and calendar color.

## Overview

The calendar area in the control panel displays a list of all existing calendars. You can update or remove existing ones, as well as create new ones here.

:::warning
Removing calendar(s) will also permanently remove ALL associated events!
:::

<Photo
img={require('@site/static/img/craft/calendar/v5/cp_calendars.png')}
alt="Calendars List"
/>

<Photo
img={require('@site/static/img/craft/calendar/v5/cp_calendar-create.png')}
alt="Create a New Calendar"
/>

Calendars allow you to set the following data for each one:

### Name

The name of the calendar that will be visible everywhere.

### Handle

The name you'll use when referring to the calendar in your templates. Auto-generated from the _Name_ field.

### Description

The description of the calendar. Can be accessed in your templates.

### Color

The unique color for each calendar. Choose from picker (Calendar also automatically internally generates a lighter and darker version of this color for use in control panel and front end templates)

### Site Setting

Enable this to set up automatic routing of URL's for your events. Enabling this will also allow you to use the Live Preview feature.

:::info
The templates will look for `event.`, not `entry.` (e.g. `event.title`, not `entry.title`).
:::

- **Event URI Format** - what the event URLs should look like. You can include tags that output event properties, such as `{slug}` or `{postDate|date("Y")}`.
- **Template** - the template to use when an event's URL is requested.

### Show the Title field

Uncheck this to set your own title format, auto-generated from other field(s).

- **Title Format** - What the auto-generated event titles should look like. You can include tags that output entry properties, such as `{myCustomField}`.

### Allow Repeating Events<Badge type="pro" text="Pro" />

Disable this option to allow only single occurrence events for this calendar.

### Forced ICS Event Timezone<Badge type="pro" text="Pro" />

Choose a timezone that will be forced upon exported ICS event dates. Default is _Floating Timezone_ (recommended), which means no timezone.

:::warning
ICS subscriptions currently do not work correctly for Google Calendar when using _Floating Timezone_. The issue is that there's a "bug" or at least oddity in [the way Google Calendar handles events with floating dates](https://productforums.google.com/forum/#!topic/calendar/Xjxs5UjhsXI) compared to all other calendaring apps. Google does not to conform to [iCal standards](https://tools.ietf.org/html/rfc5545#section-3.3.5) for this. You can work around this by setting the **Forced ICS Event Timezone** setting to a real timezone.
:::

### ICS Description field<Badge type="pro" text="Pro" />

Set the custom field which is used for event description in ICS exports.

### ICS Location field<Badge type="pro" text="Pro" />

Set the custom field which is used for event location in ICS exports.

### Design Field Layout

Works just like regular Craft field layouts. Simply create how you want your event publishing experience to be. Layouts are unique per Calendar.

Calendars also include an option to share calendars with a publicly accessible ICS subscription URL (Pro), allowing users to subscribe (one way sync) their calendaring app to your sites' calendar(s). To enable this, click on the **Share this calendar** button next to the applicable calendar(s) on the list view of calendars. Once enabled, you can then copy the ICS URL and share it with whoever you wish (admins, show it publicly, etc).
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"label": "Configuration",
"position": 4
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
---
sidebar_position: 5
title: Demo Templates
description: Install and use demo templates for Solspace Calendar 6.x in Craft CMS.
---

import { Photo } from '@site/src/components/utils';

# Demo Templates

Calendar includes a complete set of demo templates. These demo templates let you have a fully functioning area on your website with just a couple clicks! Further to this, it allows you to see real world examples of the template code in action, which will help you get acquainted with Calendar quicker.

Included in the demo templates is an implementation of the [FullCalendar JS library](http://fullcalendar.io). Users with appropriate administrative privileges will also be able to modify events.

<Photo
img={require('@site/static/img/craft/calendar/v5/cp_demo.png')}
alt="Demo Templates Install"
/>

## Installing the Demo Templates

To install the Demo Templates, simply visit the **Settings** page for Calendar and click on the **Demo Templates** nav item (**Calendar > Settings > Demo Templates**).

By default, the Demo Templates page will have **calendar-demo** as the _Install Path_ for your template path. You can change this to whatever you like. So for example, if you set the _Install Path_ value as `my-precious`, the demo templates will be installed to **site.com/my-precious/**.

During installation of demo templates, Calendar will copy the template folders and files (as shown on page) to the Craft **/templates/** directory. So using the above example, your templates would be located at **/templates/my-precious/**.

Calendar will also look for an **assets** folder in your **public** directory and attempt to load files such as CSS, JS, fonts and image files (as shown on page) to a folder inside that, named **my-precious** (using the example above). If an **/assets/** directory does not exist, Calendar will attempt to create that directory as well.

And lastly, Calendar will create several template routes for you (as shown on page) for the demo templates to work correctly.

If you ever want to refresh the demo templates back to what they were by default (or if there's been an update to them in a new version), you can simply reinstall the Demo Templates and use the same _Install Path_ value. Calendar will then overwrite the files and only add new routes (if applicable), rather than installing duplicate routes.

If you encounter any issues while attempting to install the demo templates, please see the [Troubleshooting](#troubleshooting) guide.

## Troubleshooting

If you encounter any issues trying to install the demo templates, it's likely that your database user does not have sufficient privileges or your server configuration does not allow some or all of the actions.

If you cannot change or adjust your permissions or configuration, you can install the demo templates manually. To install them manually, refer to the [Manual Install](#manual-install) instructions below.

## Manual Install

To install the demo templates manually, just follow the instructions below:

1. Inside the **/vendor/solspace/craft-calendar/src/codepack/** directory, copy the **templates** folder into the Craft **/templates/** directory, and rename the Calendar **templates** folder to **demo** (so it should now be located at **/templates/demo/**).
2. In your root public directory, create a directory called **assets** if it does not already exist.
3. Inside the **/vendor/solspace/craft-calendar/src/codepack/** directory, copy the **assets** folder into the public **/assets/** directory, and rename the Calendar **assets** folder to **demo** (so it should now be located at **/assets/demo/**).
4. Copy and paste the following routes into your _routes.php_ configuration file (**/config/routes.php**):

```php showLineNumbers
'demo/month/(?P<year>\d{4})/(?P<month>\d{2})' => 'demo/month',
'demo/month/calendar/(?P<slug>[^\/]+)' => 'demo/month',
'demo/month/calendar/(?P<slug>[^\/]+)/(?P<year>\d{4})/(?P<month>\d{2})' => 'demo/month',
'demo/week/(?P<year>\d{4})/(?P<month>\d{2})/(?P<day>\d{2})' => 'demo/week',
'demo/week/calendar/(?P<slug>[^\/]+)' => 'demo/week',
'demo/week/calendar/(?P<slug>[^\/]+)/(?P<year>\d{4})/(?P<month>\d{2})/(?P<day>\d{2})' => 'demo/week',
'demo/day/(?P<year>\d{4})/(?P<month>\d{2})/(?P<day>\d{2})' => 'demo/day',
'demo/day/calendar/(?P<slug>[^\/]+)' => 'demo/day',
'demo/day/calendar/(?P<slug>[^\/]+)/(?P<year>\d{4})/(?P<month>\d{2})/(?P<day>\d{2})' => 'demo/day',
'demo/calendars/(?P<slug>[^\/]+)' => 'demo/calendars',
'demo/event/(?P<id>\d+)' => 'demo/event',
'demo/event/(?P<id>\d+)/(?P<year>\d{4})/(?P<month>\d{2})/(?P<day>\d{2})' => 'demo/event',
'demo/events/(?P<year>\d{4})/(?P<month>\d{2})/(?P<day>\d{2})' => 'demo/events',
'demo/export/event/(?P<id>\d+)' => 'demo/export',
'demo/export/calendar/(?P<id>\d+)' => 'demo/export',
'demo/fullcalendar/(?P<slug>[^\/]+)/(?P<year>\d{4})/(?P<month>\d{2})/(?P<day>\d{2})' => 'demo/fullcalendar',
'demo/resources/event_data/(?P<id>\d+)' => 'demo/resources/event_data'
```

Visit your demo templates at: **yoursite.com/demo**
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
---
sidebar_position: 4
title: Permissions
description: Set user and group permissions for Solspace Calendar 6.x in Craft CMS.
---

import { Photo } from '@site/src/components/utils';

# Permissions

Solspace Calendar ties into regular Craft User Group Permissions. Simply visit the permissions page for the applicable user group(s) (**Settings > Users > User Groups**) to grant/edit/remove permissions to Calendar.

Calendar 6 reorganizes permissions to match the structure used by Freeform. The older Calendar permission IDs are migrated to the new IDs during the Calendar 6 update so existing user group access continues working.

<Photo
img={require('@site/static/img/craft/calendar/v5/cp_permissions.png')}
alt="Permissions"
/>

- **General**
- _Access Calendar_ - required for users to access Solspace Calendar at all.
- **Access Events**
- _Read All Events_ - allows users to view events in all calendars. This overrides individual _Read Events by Calendar_ selections.
- _Read Events by Calendar_ - allows users to view events in selected calendars only.
- _Manage All Events_ - allows users to create, edit, delete, and save events in all calendars. This also grants read access and overrides individual _Manage Events by Calendar_ selections.
- _Manage Events by Calendar_ - allows users to create, edit, delete, and save events in selected calendars only.
- **Access Calendars**
- _Create New Calendars_ - allows users to create calendars.
- _Delete Calendars_ - allows users to delete calendars.
:::danger
Deleting a calendar deletes ALL events associated with that calendar as well, so be careful which users have access to this permission.
:::
- _Manage All Calendars_ - allows users to edit all calendars.
- _Manage Calendars Individually_ - allows users to edit selected calendars only.
- _Access Settings_ - access to the settings area for Calendar and [Demo Templates](../configuration/demo-templates.mdx) install page.
- _Access Resources_ - access to the resources area for Calendar.
Original file line number Diff line number Diff line change
@@ -0,0 +1,122 @@
---
sidebar_position: 7
title: Project Config
description: Manage Solspace Calendar 6.x settings via Craft CMS Project Config.
---

# Project Config

Calendar supports Craft's [Project Config](https://craftcms.com/docs/5.x/system/project-config.html). You can modify the general configuration and settings for Calendar, as well as settings and field layouts for each calendar.

## General config for Calendar

All of Calendar's settings can be controlled/overrided here (in `/config/project/project.yaml`):

```yaml showLineNumbers
calendar:
edition: pro # You'll get license errors if you don't have a valid Pro license.
enabled: true
licenseKey: EXAMPLETEST12EXAMPLETEST
schemaVersion: 4.0.0
settings:
pluginName: '' # Custom name for plugin (Pro).
firstDayOfWeek: '-1' # The starting day of the week when viewing front end and control panel Month and Week views as well as datepickers. '-1' is default, which the current user's locale. '0' is Sunday, '1' is Monday, etc.
timeFormat: auto # Time format for dates and date pickers. 'auto' is current user's locale, Use '12-hour' or '24-hour' to set the same for all users.
showMiniCal: '1' # Displays a side menu with mini calendar and list of calendars, allowing you to filter your event results.
showDisabledEvents: '1' # Events that are disabled will be displayed in the views with faded styles.
quickCreateEnabled: '1' # Allows all users with event creation privileges to use the Quick Create event feature.
authoredEventEditOnly: '1' # Users (excluding Admins) with event creation privileges will only be able to edit or delete their own events.
defaultView: month # The default page to go to when clicking the Calendar nav item.
demoBannerDisabled: '1' # Hides the alert message suggesting to install demo templates when this setting is enabled.
eventDuration: '60' # The default event time duration for fieldtype, in minutes.
timeInterval: '30' # The time picker interval for fieldtype, in minutes.
allDay: '' # Have the 'All Day' option selected by default for new events.
overlapThreshold: '5' # The amount of hours in the next day which are still considered as those of the previous day.
guestAccess: # The calendar ID's guests should have access to create events for on the front end.
- '5'
- '1'
- '3'
- '6'
```

## Settings & field layouts for Calendars

Calendar will also store settings and field layouts for calendars (e.g. `/config/project/solspace/calendar/calendarsblueThunder--59e6448b-613a-424c-98db-f9ae36dd2bc8.yaml`) and will look something like this:

```yaml showLineNumbers
name: 'Blue Thunder'
handle: blueThunder
description: ''
color: '#20A8B9'
allowRepeatingEvents: true
icsHash: ac3478d69a3c81fa62e60f5c3696165a4e5e6ac45aaa947450b782.65239311
icsTimezone: floating
descriptionFieldHandle: '0'
locationFieldHandle: '0'
hasTitleField: true
titleFormat: ''
titleLabel: Title
siteSettings:
2394f11a-d45d-40d2-a5ee-5bd9f176417d:
enabledByDefault: true
hasUrls: true
siteId: 5f1d37f9-004d-414a-8e9c-48d763fba635
template: blue-thunder/_entry
uriFormat: 'blue-thunder/de/{slug}'
5968dff9-9263-456b-8f8e-5bb02b73f377:
enabledByDefault: true
hasUrls: true
siteId: 24990881-e55d-42d1-b228-92652cf50dfb
template: blue-thunder/_entry
uriFormat: 'blue-thunder/fr/{slug}'
a8560321-d302-4716-8045-13345fb36adf:
enabledByDefault: true
hasUrls: true
siteId: bfdeaad5-5273-4cf1-a390-05c8929e7795
template: blue-thunder/_entry
uriFormat: 'blue-thunder/{slug}'
c07e3df4-aa17-46a3-8ffa-077719d56011:
enabledByDefault: false
hasUrls: false
siteId: 8f0a08fa-5b1c-4c7b-84dd-bd93d571d031
template: null
uriFormat: null
fieldLayout:
tabs:
- elements:
- fieldUid: ad144815-0d08-4ec6-948a-0b0c00190e2d
instructions: null
label: null
required: '0'
tip: null
type: craft\fieldlayoutelements\CustomField
warning: null
width: 100
- fieldUid: 252c0982-bae0-4040-b669-e2fd9149eff6
instructions: null
label: null
required: '0'
tip: null
type: craft\fieldlayoutelements\CustomField
warning: null
width: 100
- fieldUid: 390f343e-55c9-4362-996f-60e17d649e62
instructions: null
label: null
required: '0'
tip: null
type: craft\fieldlayoutelements\CustomField
warning: null
width: 100
- fieldUid: fcdc1067-21d1-4a91-8094-b38a27c60ebb
instructions: null
label: null
required: '0'
tip: null
type: craft\fieldlayoutelements\CustomField
warning: null
width: 100
name: 'Tab 1'
sortOrder: 1
uid: 079608e5-4374-408a-b6de-ad776486ba33
```
Loading