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

Create preview field in data to get rid of hacky regex #106

Open
Slange-Mhath opened this issue Oct 16, 2023 · 0 comments
Open

Create preview field in data to get rid of hacky regex #106

Slange-Mhath opened this issue Oct 16, 2023 · 0 comments

Comments

@Slange-Mhath
Copy link
Collaborator

This is a QoL issue, as it will help us in the long run, but wont fix any current problems.

Problem:

To display the preview filed on the index page we are currently using a helper method called build_preview_content_html

While this works it is very prone to inconsistencies and changes in the data. It will also slow things down a little bit as the iteration over every strings, which in some cases are not the shortest, might affect the loading time of our catalogue.

Solution:

A possible solution would be to tweak the data and create a new preview field in a similar way we have other fields (like display).
I guess we'd be able to run a query to get the data for this new field in a similar fashion we do it now via regex, with the huge benefit that we'd only need to do it once and then having it clean and nicely separated from blacklight.

In Blacklight we'd just need to add a new index field to the catalogue controller and achieve the same behavior.

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

No branches or pull requests

1 participant