Finds pages by search query.

0 stars out of 5

0 0 0 0 0
  • Author Taufik Nurrohman
  • Maintainer 1
  • Member
  • Version 3.0.1
Table of Contents
  1. Usage
  2. Recursive Search


Append ?query=search+query to the pages URL to search pages by file name or file content.

Add this snippet just before the </header> in header.php file of your active layout to add the default search form:

  <?= self::form('search'); ?>

You can also define specific search query parameter key and route in this default search form component:

  <?= self::form('search', [
      'key' => 'search.term', // Custom search query
      'route' => '/product/zoids' // Custom search context
  ]); ?>

This page conditional statement is available to quickly determine the type of page we are currently in:

Return true if current page is a search results page.

There is a recursive page search feature available from the /search route:

  <?= self::form('search', ['route' => '/search']); ?>

If there is a page file stored as .\lot\page\search.archive or .\lot\page\, then that file will come first. To avoid this route conflict, you can change the default search route (which is '/search') to something else in the state file.


No comments yet.