Skip to content

Commit

Permalink
Update making-item-search-shareable.md content
Browse files Browse the repository at this point in the history
  • Loading branch information
b-lawlor authored Sep 19, 2024
1 parent e6524b3 commit e1fd59a
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions blog/making-item-search-shareable.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ next:
link:
---

This idea had been around for a while, but besides a couple of comments affirming that it would be useful to library staff and support, and a growing list of CC's and `See Also` bugs, it wasn't gaining any traction.
This idea had been around for a while, but besides a couple of comments affirming that it would be useful to library staff and support, and a list of CC's and `See Also` bugs, it wasn't gaining any traction.

Intuitively I knew that the item search form must somehow be passing all the parameters that it needs to perform a search to the backend where they would be transformed into a database query so that results could be returned and rendered in the template. As Michalangelo said [the sculpture is already complete within the block](https://www.goodreads.com/quotes/1191114-the-sculpture-is-already-complete-within-the-marble-block-before). Item search already knows how to process search parameters and return results. All we have to do is some chiseling to get the search parameters encoded as a url and persuade Koha handle them that way too.
Intuitively I knew that the item search form must somehow be passing all the parameters that it needs to perform a search to the backend where they would be transformed into a database query so that results could be returned and rendered in the template. As Michalangelo said [the sculpture is already complete within the block](https://www.goodreads.com/quotes/1191114-the-sculpture-is-already-complete-within-the-marble-block-before). Item search already knows how to process search parameters and return results. All we have to do is chisel out the url encoded search parameters and Sharable Item Search will be revealed.

Creating the `Copy shareable link` button was pretty straightforward javascript. I soon realized that in oder to support the `Edit search` button, we would need to populate the item search form from the url parameters. That meant the item search template would need to be fully massaged to work out all its kinks through serveral sessions over the course of four months.
Creating the `Copy shareable link` button was pretty straightforward javascript. Then I realized that to support the `Edit search` button, the whole Item Search Template Toolkit would need some resculpting to render all the url parameters in the form inputs. Then JavaScript could submit the form and the Item Search would just do its thing.
<Bug :id='14322'/>

Like the patch that added multi select parameters to Koha reports this patch called for unconventional thinking to solve a practical problem. Fortunately this time the code seems to have been accepted as a more natural pattern. At least it hasn't been called a hack yet!
Like the patch that added multi select parameters to Koha reports this patch called for unconventional thinking to solve a practical problem. Fortunately this time the code seems to have been accepted as a more natural pattern. At least it hasn't been called a hack yet!

0 comments on commit e1fd59a

Please sign in to comment.