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 a "mode" parameter for media display #173

Open
ghost opened this issue Mar 18, 2016 · 1 comment
Open

Add a "mode" parameter for media display #173

ghost opened this issue Mar 18, 2016 · 1 comment

Comments

@ghost
Copy link

ghost commented Mar 18, 2016

As media display strategies are not aware of the context, it is not possible to have a different rendering for a same format of a media. It could be useful to give ability to pass a third parameter to specify a rendering "mode" to the method \OpenOrchestra\Media\DisplayMedia\DisplayMediaInterface::displayMedia().

Here is an example use-case :

  • For my advertisement banner, I want to display an image/video corresponding to the original format of a media using only the <img> or the <video> tag.
  • For my slideshow, I want to display an image/video corresponding to the original format of a media and, net to it, a description of the media and its credits. To do so, I want to use <figure>, <figcaption> and a the <img> or <video> tag.

If I had a "mode" parameter, I would have one called "media_only" and one called "figure" that can be used to adapt the rendering.

@ngilain
Copy link
Member

ngilain commented Mar 18, 2016

For the second case I assume you are in the context of a block. In that context you have access to the block controller, so you are able to get from the controller all the media attributes you want without using the display_media() helper in the twig. That way you can construct the media tags manually in the twig of the block. This is done in the gallery block and the slideshow block delivered with Open Orchestra.

Nethertheless, It could be a good feature to add to Open Orchestra to allow more elasticity to the dev process.

@alavieille alavieille added this to the on roadmap milestone Mar 29, 2016
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

3 participants