Skip to content

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

@Slange-Mhath

Description

@Slange-Mhath

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions