Basic Setup

To enable PAGEGRID on any custom ProcessWire page template, call these three core functions in your template file in site/templates/:

<div id="content">
  <?= $pagegrid->styles($page); ?>
  <?= $pagegrid->renderGrid($page); ?>
  <?= $pagegrid->scripts($page); ?>
</div>
  • styles($page) – Loads CSS for the grid and active blocks.
  • renderGrid($page) – Renders the HTML markup for your layout.
  • scripts($page) – Loads JS dependencies and block scripts.

Placement: While styles() typically belongs in <head> and scripts() before </body>, placing all three inside your content region (e.g. _main.php Markup Regions) is fully supported for simpler template setups.


Conditional Rendering

Use $pagegrid->isBackend() to hide decorative elements or heavy animations while editing in the admin:

<?php if (!$pagegrid->isBackend()): ?>
  <!-- Hidden in the PAGEGRID editor, visible on the live site -->
<?php endif; ?>