-
Hi Johannes, i have a following question In coverpage.hbs I found a block of code that displays all metadata fields.
Is it possible to add some if statement to hide concrete name in metadata? |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments
-
Sure, this can easily be accomplished by using a handlebars conditional that checks the label ( |
Beta Was this translation helpful? Give feedback.
-
Hi, i am not sure, that i marked a correct piece of code, that responcible for displaying metadata: Can you add some example in documentation: For example not display metadata if name is "creator" |
Beta Was this translation helpful? Give feedback.
-
So the part in the template that you want to modify is located here: https://github.com/jbaiter/pdiiif/blob/main/pdiiif-api/assets/coverpage.hbs#L245-L266 This is a loop over all metadata entries, which are tuples/arrays with two elements, with the first value ( As I was writing this comment, I noticed that the required helpers for comparing strings are currently not available in pdiiif templates. I'll ship a version soon that will include them, then you can change your template in |
Beta Was this translation helpful? Give feedback.
So the part in the template that you want to modify is located here: https://github.com/jbaiter/pdiiif/blob/main/pdiiif-api/assets/coverpage.hbs#L245-L266
This is a loop over all metadata entries, which are tuples/arrays with two elements, with the first value (
this.[0]
) being the label of the manifest entry, and the second (this.[1]
) the value/values.What you want to do is to skip a loop iteration if the key matches your criterion, i.e. it equals
creator
. You can do this by wrapping the<div class="propertyvalue">...</div>
in an{{#if ...}}
block that checks your criterion.As I was writing this comment, I noticed that the required helpers for comparing strings are currently not availab…