Configuration
TypoScript Configuration
The extension registers a Fluid Partial path for ke_search:
plugin.tx_kesearch_pi1 {
view {
partialRootPaths {
1000 = EXT:ke_search_honeypot/Resources/Private/Partials/
}
}
}
This makes the honeypot partial available in your ke_search templates.
Template Integration
Add the partial to your search form template:
<f:render partial="honeypot" />
The partial renders:
<div style="margin-left: -99999px; position: absolute;">
<label for="kesearch_hp">Diese Feld nicht ausfüllen!</label>
<input autocomplete="new-kesearch-hp" tabindex="-1"
type="text" name="tx_kesearch_pi1[__hp]" value="" />
</div>
Middleware
The extension uses a PSR-15 middleware to check search requests.
The middleware checks if:
- A ke_search form was submitted (
tx_parameter exists)kesearch_ pi1 - The honeypot field (
tx_) is missing or filledkesearch_ pi1 [__ hp]
If a bot fills the honeypot field, the request is rejected with 403 Forbidden.
The middleware is automatically registered in Configuration/ -
no manual configuration needed.
Customization
Custom Honeypot Field Name
If you want to use a different field name, override the partial in your own extension or template:
<!-- Your own Partials/honeypot.html -->
<div style="margin-left: -99999px; position: absolute;">
<input type="text" name="tx_kesearch_pi1[my_custom_field]" value="" />
</div>
Then update the middleware check accordingly.
Custom Styling
The default partial uses position: absolute with negative margin. You can
override this with your own CSS or by creating a custom partial.
Note: Don't use display: none as some bots detect this. Use positioning
off-screen instead.