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

Allow data sourcing from an external provider in a template #114

Open
MrGecko opened this issue Feb 21, 2018 · 0 comments
Open

Allow data sourcing from an external provider in a template #114

MrGecko opened this issue Feb 21, 2018 · 0 comments

Comments

@MrGecko
Copy link

MrGecko commented Feb 21, 2018

Related to: Capitains/MyCapytain#159

In order to be able to enrich some data on the rendered page (like adding some typographical info to a title), it would be nice to be able to load some versions of it from an external data provider (database, service, flat file...).

It may be achieved by using a new jinja filter like :
{{collection.title|enrich("title", collection.id, collection.lang)}}

Which is then linked to a new enhanced resolver :

class MetadataEditorialResolver()
    def find(data_name, coll_id, coll_lang):
        if data_name == "title":
            get_data_from_sqlite(data_name, coll_id, coll_lang)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant