No display from Full Calendar page

Probably I’m doing something stupid, but not sure how to find out. I have installed the Full Calendar plugin and enabled it. Created a new page, with the only content being:

[fullcalendar icsfile="green.ics"][/fullcalendar]

There is an ICS file in user/data/calendars called green.ics. It came from exporting a Google calendar. Unfortunately, nothing at all is displayed on the page. How can I figure out what is wrong?

Have you enabled “use custom page template”?

Thanks. I didn’t quite understand that, but it prompted me to look at the options for “Page template” during page creation. I found a “Calendar” option and if that is chosen, then the page works. Seems like leaving the page template as default was the problem. What does “use custom page template” mean (I see it is a plugin option, but it didn’t mean anything to me)?

Actually I’m not really sure :grinning_face_with_smiling_eyes:

I had the same trouble as you initially. I assumed that I wasn’t using a custom page template, just the generic style that came with the theme. But found I had to enable it to see the calendar. Might be something for @hoernerfranz to clarify in a later version.

@counterpoint, @ozfiddler,

To display the calendar the name of the page should be calendar.md. The page will then be rendered using template /user/plugins/fullcalendar/templates/calendar.html.twig which will then create the calendar.

When variable useCustomPageTemplate is false the plugin will only be activated on pages named calendar.md.
When variable useCustomPageTemplate is set to true, the plugin will be activated on each and every page.

The following happens when the plugin is activated:

  • it adds ~15 extra assets (js/css files) to the page
  • it tries to find and process the shortcode in the content (markdown) of the page. This only happens once when page content is being parsed before caching.

When a page is parsed and cached, the plugin will no longer search for the shortcode on the page, but the extra assets are still being added.

After the cache is cleared or stale, the page needs to be parsed again and the plugin will also run.

2 Likes

ah, a thread dedicated to my fullcalendar plugin … :smiley:
and yes, the problem already seems to be solved, as @pamtbaau explained in brief how the plugin works.
I just want to add 2 hints:

@counterpoint : if your calendar source is a public google calendar, you can also use that directly, you only need to figure out the correct absolute URL to the ics representation, see this article and use that in the shortcode.
this way, your grav calendar page will always be up-to-date with your calendar source, no need to constantly export that !

and, yes , it might be not so clear why there is an Option useCustomPageTemplate - as already explained, if set to true, the plugin will be activated on all pages, and, as it loads quite a lot of js/css stuff, will affect the page speed ranking of your whole grav site.
so, the recommendation is to just use the page template provided by the plugin (or a modified copy in your theme folder) so it will only be activated on your calendar page.

maybe I should also add a screenshot that shows the selection of a page template in the plugin’s README ? (I assumed this is a standard procedure well known by grav users, so far).

That is certainly a very valid point and makes a lot more sense to me now. I think just a more explanatory selector name in the settings is all that is needed. Maybe “Enable on all page templates” with hover help that says “If this setting is disabled the calendar will only be enabled on the calendar.md template”. Or something like that.

Ah, OK. So if I use this direct link method then I don’t need to worry about caldav2ics plugin at all? It will update automatically?