Skip to content

Commit

Permalink
Add caution note about invoking photoswipe in a modular template with…
Browse files Browse the repository at this point in the history
… caching; ref Karmalakas#3, Karmalakas#1
  • Loading branch information
hughbris committed Jun 28, 2023
1 parent 697a078 commit 3eccc0c
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,12 @@ Every page can override config options. You can pass theme as a third parameter
{{ photoswipe('id', 'a', page.header.photoswipe.options) }}
```

> **If you call the Twig photoswipe function from a modular template**, you must add this to the modular page's frontmatter: `never_cache_twig: true`. You don't need to do this if your site has caching disabled.
>
> If caching is enabled _and_ your photoswipe gallery is invoked in a modular template, all of the assets that make photoswipe work are omitted from the cache. You will see the gallery unstyled and unscripted and lightboxes will not work.
>
> [Issue #1: Assets not loading with twig cache enabled](https://github.com/Karmalakas/grav-plugin-photoswipe/issues/1) has more details.
## Installation

Installing the Photoswipe plugin can be done in one of three ways: The GPM (Grav Package Manager) installation method lets you quickly install the plugin with a simple terminal command, the manual method lets you do so via a zip file, and the admin method lets you do so via the Admin Plugin.
Expand Down

0 comments on commit 3eccc0c

Please sign in to comment.