Open swcurran opened 2 years ago
@swcurran ,
having multiple layouts in OCA bundle is definitely doable and we address it, but the question remains how to navigate across layouts in the bundle. We can obviously leave it to the consumer so you can decide upon whatever criteria, but there's a light in the tunnel, because we're having meta.json
that contains some metadata about the bundle. There will add the layout names.
Sample usage of the parser would then look like:
./parser parse oca -p <file-path> --credential-layout <layout-name>=<layout-path> --credential-layout <layout-name>=<layout-path> --form-layout <layout-path>
So in the end you might have multiple credential layouts.
Sounds good.
I was thinking more about this, and wondered if it is technically possible to have one layout, and conditional handling to have that layout used in different places. Is that technically possible? Is it a good idea?
OCA bundle is self sufficient. Therefore it contains everything that is needed in given context to capture/render information. If you ask whether it makes sense to have one "big" layout that conditionally handles its use cases (and edge cases), then it would usually depend of how different these edge cases are (so whether to split among many layouts or try to keep them as one with additional conditional logic). If you can elaborate your use cases of layouts, then it might be easier to find proper solution.
The main use case we have is a "standalone credential" (full) and a list of credentials in a stacked view, where we only see the top of each credential -- like in a physical wallet.
In a wallet holding credentials, we will likely have at least two credential layouts that combine layout (colour, perhaps background image), text (name of credential type - multilingual), issuer name, attribute labels and data. The ones we know about:
How does one specify multiple credential layouts with a type associated with each so that the display tool can know when to display one or the other?