Content Access

Klub uses gates (usually provider price IDs) to control access to pages, files, and blocks. A gate is granted by an active subscription, a one-time payment, or a manual gate stored on the user.

Gate fields

Add a gates field (or your custom key from ProviderGates::$field) to the blueprints you want to protect. Klub ships helper fields:

  • fields/klub/gates/plans (subscription plans)
  • fields/klub/gates/products (one-time products)

Content helpers

Use the built-in methods in templates:

  • $page->allows() / $page->isAllowed() / $page->isNotAllowed()
  • $page->hasGate($priceId)
  • $file->allows() / $file->isAllowed() / $file->isNotAllowed()
  • $file->hasGate($priceId)
  • $block->hasGate($priceId)
  • $blocks->removeNotAllowed() and $files->removeNotAllowed()

Global helpers:

  • klub()->allows($gates) / klub()->disallows($gates)
  • klub()->owns($priceIdOrProduct)
  • site()->klub() (returns the Klub instance)
Kirby Klub is not affiliated with the developers of Kirby CMS. We are merely standing on the shoulder of giants.
© 2026 Bruno Meilick All rights reserved.