Styling Metadata Value - Freedom Theme

I am trying to style a specific metadata property value using the CSS Editor module but nothing seems to work except calling the specific position of the property. Can you tell me why that is happening?

What specific selectors/styles are you trying that aren’t working? And which ones are working?

I am trying to style the contents of a specific metadata property and I thought I would be able to target it using the property name as a class. However, it seems like all the metadata values are being stored in a generic value-content class. So, I can only target the metadata property by position and not by name. I am able to style the value using the position but I have multiple resource templates and the second metadata property is different depending on the template. Do you have any suggestions on how to remedy this issue? Thank you.

Hi, my suggestion would be to edit the view/common/resource-values.phtml template of your theme and add a class name based on the RDF term of the property (eg dc:title, schema:category etc.).

Thank you very much for your suggestion. I don’t have access to those files so I will have to reach out to another staff member.

Hi @cmrobin,
I’ve just pushed an update to the Freedom theme to add individual classes per property type. It will be included in the next release, but in the meantime you can download the master branch here: GitHub - omeka-s-themes/freedom: An Omeka S Theme · GitHub.

1 Like

Hi Nelson,

Thank you so much! This is great news!

Kind regards,

cmrobin

I would prefer data attributes here in stead of class names. This preserves the exact term without sanitization.

<div class="property" data-property-term="dcterms:title">

The property can be queried with a CSS attribute selector:

[data-property-term="dcterms:title"] { font-weight: bold; }