Suggestions for the location field
If the content element uses the address search field "Search field with suggestions" (see Address search field), the search form suggests ZIP codes and cities while the visitor types.
How it works
The JavaScript of the job board sends a POST request with the HTTP header
jobboard- and the form field zip after
three characters. The request goes to the URL of the current page, which
the search form provides in the attribute
data-. If the attribute is missing,
the path of the current page in the browser is used. The PSR-15 middleware
\JWeiland\ (identifier
jweiland/) answers every frontend request
with this header with a JSON list of up to five entries:
curl -X POST -H 'jobboard-address-search: 1' \
-d 'zipCity=123' https://example.org/jobs
["12345 - Sample Town", "12349 - Sample Town-North"]
The middleware searches the fields ZIP code and city of all address
records (
tt_) in the pages of the site setting
jobboard.storagePid. It respects the usual frontend
restrictions (hidden, deleted, start and end time). Each combination of
ZIP code and city is returned once, sorted by city.
Own search form templates
The attribute is rendered in Partials/. If you
override this partial, add it to your
<f: as well:
<f:form action="search"
data="{jobboard-address-search-url: '{f:uri.page()}'}">
Security
The address table is shared with other extensions and can contain personal data. Therefore:
- The pages to search are always taken from the site setting
jobboard.storagePid of the current site, never from the
request. The TypoScript setting
plugin.is not used.tx_ jobboard. persistence. storage Pid - Only ZIP code and city are returned, no other fields.
- An empty search term or an empty storage setting returns an empty list.
Keep only addresses that may be public in the folders listed in jobboard.storagePid. Every address in these folders is searchable, not only the addresses used by jobs.