DEV-NOTES:
-
Add the entries
james-searchandjames-search-resultsto your page template.
If you need JamesSearch on all pages, add the entries to the filetemplates/layout/base.html.twig. -
To add custom responses, change the value of the variable
$responsesPathin the filephp/Api/Action/JamesSearch.phpto the desired path.
For example:$responsesPath = __DIR__ . '/../../../storage/private/james-search/';
The subfolder structure should remain the same as the structure invendor/james-search.com/james-search.com-ui-component/api-dummy/responsesand the filenames must represent the queries you can type.
As a quickstart, you can copy the dummy responses and modify the names and content to your needs.
DON'T FORGET to add the path to the white list in.gitignore.
$responsesDirectory = __DIR__ . '/../../../storage/private/james-search/'; - Documentation, samples and inputs available for testing: james-search.com-ui-component.netigo.dev.
-
Important: The delimiters in template are
<%and%>. To avoid escaping when rendering, use an ampersand<%&. BE
For a solution without james-search, click here.
James-Search in Modal:
To place James-Search (form & suggest-box) in a modal, please follow these instructions:
-
Create a new BS-modal for James-Search inside a new file:
templates/partials/modal/james-search.html.twig. -
Add to the modal an id e.g.
jamesSearchModal. -
Copy the James Search
james-search-field-wrappersnippet from heretemplates/partials/header/header.html.twigand paste it inside themodal-body. -
Change the James Search form id e.g.
modal-james-search-form. -
Add the James Search option
targetand its selector (container) e.g.data-target="#search-box-wrapper". -
Append to the
modal-bodythe container (target) element with the defined idsearch-box-wrapper. -
Add the modal to the DOM by including it to this file
templates/layout/base.html.twig. (insidebody-container) -
trigger the modal e.g.
data-bs-target="#jamesSearchModal".