Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add search page module and remove controller extension #58

Merged
merged 2 commits into from
Oct 28, 2024

Conversation

sascha-karnatz
Copy link
Contributor

The controller methods were available on every page in Alchemy and was listening to the query param. This approach is not really extendable, if you need multiple parameter to process the search result. The main logic was moved into a SearchPage module which has nearly the same structure as before, but is now way more flexible, because it is only used in this particular page layout. It also allows the application to extend the search and the view without monkey patching the gem. The only downside is, that it isn't possible anymore to add a search string the searchresults - element to test the search in the admin interface.

@tvdeyen tvdeyen added this to the v6.0 milestone Oct 14, 2024
The controller methods were available on every page in Alchemy and was listening to the query param. This approach is not really extendable, if you need multiple parameter to process the search result.
The main logic was moved into a SearchPage module which has nearly the same structure as before, but is now way more flexible, because it is only used in this particular page layout. It also allows the application to extend the search and the view without monkey patching the gem.
The only downside is, that it isn't possible anymore to add a search string the searchresults - element to test the search in the admin interface.
The helper method was only a short cut for the results partial, but it was using the global search_results variable from the previous controller_methods extension. With the SearchPage module it isn't necessary anymore to have a global variable.
@tvdeyen tvdeyen merged commit 21049ae into AlchemyCMS:main Oct 28, 2024
1 check passed
@sascha-karnatz sascha-karnatz deleted the search-page-module branch October 28, 2024 13:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants