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

Add data-type classes to resource property values #2248

Closed
allanaaa opened this issue Dec 11, 2024 · 10 comments
Closed

Add data-type classes to resource property values #2248

allanaaa opened this issue Dec 11, 2024 · 10 comments

Comments

@allanaaa
Copy link

As per this forum post: https://forum.omeka.org/t/tables-this-is-an-answer-not-a-question/24116/6

One user wants to apply styles based on the data types of property values (NDT integers, NDT timestamps, text, URI, etc.).

I think it's always worth offering a bit more selectability for designers.

@kimisgold
Copy link
Member

We already do this with data types offered by the core, so we should probably file issues in modules that have not provided a data type selector on the value wrapper.

@kimisgold
Copy link
Member

It actually looks like we're not setup for data types to provide a class to the resource-values.phtml partial. I've set up a default data type class that takes the value type and formats it into a nice css selector.

@kimisgold
Copy link
Member

image

Here's what it should look like in both the public and admin views, with a getty value suggest data type highlighted in the inspector. @allanaaa, could you test with any data types you can think to see if it looks as it should?

@allanaaa
Copy link
Author

I like it - but can we send the module name as a separate class - "valuesuggest getty-cona" instead of "valuesuggest-getty-cona"? That would allow people to style more broadly.

I am also getting "valuesuggestall-rightsstatements-rightsstatements" and I'm not sure where the "all" is coming from.

@jimsafley
Copy link
Member

I am also getting "valuesuggestall-rightsstatements-rightsstatements" and I'm not sure where the "all" is coming from.

The valuesuggestall- prefix indicates to the ValueSuggest JS that all suggestions should be loaded on one request.

@kimisgold
Copy link
Member

I like it - but can we send the module name as a separate class - "valuesuggest getty-cona" instead of "valuesuggest-getty-cona"? That would allow people to style more broadly.

I am also getting "valuesuggestall-rightsstatements-rightsstatements" and I'm not sure where the "all" is coming from.

Currently, I'm getting .valuesuggest-getty-cona from valuesuggest:getty:cona. To what level should these values be grouped or separated out? I think I might need a better understanding of how data type names are formatted if I'm going to use them to create css selectors. Right now I've got an exception for custom vocab data types that seem to always use the format customvocab:{$id}. I currently format them as .customvocab-{$id}.

@zerocrates
Copy link
Member

We can't assume much about the structure of data type names... they can be anything, really.

@kimisgold
Copy link
Member

Is there a better source for constructing css classes for data types?

At least in its current state, designers could target data types associated with a module by constructing a selector like [class*="valuesuggest"], targeting classes that contain "valuesuggest".

@zerocrates
Copy link
Member

Providing information about what module a data type came from just sort of isn't designed into the system. You could come up with ways, but I'm not sure we'd want to use them, like looking at the PHP class name or something.

@kimisgold
Copy link
Member

I think I'm going to leave it as is for now with everything in the data type getting hyphenated to make a class.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants