silverstripe / cwp

Common Web Platform (CWP) features module. We strongly recommend using it for all new CWP projects. Future features will be delivered here.
https://www.cwp.govt.nz
BSD 3-Clause "New" or "Revised" License
10 stars 26 forks source link

Search docs should mention that you need BasePageController #202

Open chillu opened 5 years ago

chillu commented 5 years ago

Looking at the search docs, there's an expectation that you're using PageController extends BasePageController, which is the default through cwp/installer. BasePage pulls in a lot of stuff that can be unnecessary for CWP projects (e.g. "related pages"), and many CWP devs will remove it from their own inheritance structures.

Which is an issue if you're then following the search docs, because the CWP default search behaviour is configured through:

---
Name: cwpsearchextensions
---
CWP\CWP\PageTypes\BasePageController:
  extensions:
    - CWP\Search\Extensions\SearchControllerExtension

Unless you have this installed, you won't see a search box in your Watea theme. This chain of events is so hard to follow that devs will likely spend hours debugging why their search isn't showing. We should mention that dependency in the CWP search docs.

robbieaverill commented 5 years ago

This chain of events is so hard to follow that devs will likely spend hours debugging why their search isn't showing.

I've done that multiple times