Introduction
Gates
The Klub plugin uses the term gates to define permissions for access to certain objects within the Kirby CMS.
For example, to limit access to a course you want to sell to your members, you would set one or more Stripe price IDs as gates for that page. If you sell digital goods, you will set the price ID of a one-time-purchase product as a gate to the corresponding page.
While it would be possible to define the list of available gates manually, it is recommended that the API of the Klub plugin be used to retrieve them.
To connect Stripe with your content in Kirby you will need either one of the following two fields or possibly both. While the Klub plugin offers generic fields klub/gates/plans
and klub/gates/products
I would suggest you create them yourself and adjust them as needed.
Subscription plans from Stripe
translate: false
type: checkboxes
label: Gates Plans
columns: 4
options:
type: query
query: "site.klub.plans"
text: "{{ item.product.name }} {{ item.nickname }} [{{ item.unit_amount }}]"
value: "{{ item.id }}" # price.id
You can also use the klub/gates/plans
-field to get started quickly.
One-time purchases from Stripe
translate: false
type: checkboxes
label: Gates Products
columns: 4
options:
type: query
query: "site.klub.products('one_time')"
text: "{{ item.name }} {{ item.default_price.nickname }} [{{ item.unit_amount }}]"
value: "{{ item.default_price.id }}" # price.id
You can also use the klub/gates/products
-field to get started quickly.