Hi, there!
I’m new to grav.
I have added a blueprints/flex-objects/books.yaml with FileStorage. Also added a config/plugins/flex-objects.yaml including my blueprint.
On the admin side, everything’s fine : flex objects appears in sidebar and I can manage my books collection. I got 2 books encoded and, according to storage info in blueprint, grav creates json files like dc4450d01b354fcc546782c88eb9a3f4.json in user/data/flex-objects/books/ which is what I want.
The issue lies in the front end. I created a page with template books.html.twig. But the page displays “NO BOOK FOUND”. Here is the template :
{% extends ‘partials/base.html.twig’ %}
{% block content %}
Books Collection
{% set books_dir = grav.flex.directory('books') %} {% set keys = books_dir.keys() %}-
{% for book in books_dir.all(keys) %}
- {{ book.title }} by {{ book.author }} {% else %}
- No books found. {% endfor %}