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

Provide a Context condition that detects a file's mimetype #1138

Closed
mjordan opened this issue Jun 2, 2019 · 4 comments
Closed

Provide a Context condition that detects a file's mimetype #1138

mjordan opened this issue Jun 2, 2019 · 4 comments
Assignees

Comments

@mjordan
Copy link
Contributor

mjordan commented Jun 2, 2019

A Context condition that detects a file's Mime type would be useful, for example, to create a Context that displayed a file of a specific Mime type using a specific view mode.

@mjordan
Copy link
Contributor Author

mjordan commented Jun 5, 2019

As discussed at the June 5 Tech call, I will create this condition and open a PR.

@mjordan mjordan self-assigned this Jun 5, 2019
@kayakr
Copy link
Contributor

kayakr commented Jun 12, 2019

@mjordan You may be across this already by the code in https://www.drupal.org/node/3055302 #4 could be relevant to you.

@mjordan
Copy link
Contributor Author

mjordan commented Jun 22, 2019

@kayakr thanks for the pointer. Turns out I don't need to detect the MimeType, I can get it using the $file->getMimeType() method from Drupal\islandora\MediaSource\MediaSourceService. I'll be issuing a PR as soon as I can get past #1179 so feel free to comment on my implementation there if you want.

@mjordan
Copy link
Contributor Author

mjordan commented Jun 27, 2019

Closing since #145 has been merged.

@mjordan mjordan closed this as completed Jun 27, 2019
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

2 participants