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

How safe is it to rename / delete the media display modes and image styles localgov_media installs #162

Open
andybroomfield opened this issue Jan 26, 2023 · 3 comments
Labels
question Further information is requested

Comments

@andybroomfield
Copy link
Contributor

The localgov_media submodile has become a depnedancy of quite a few modules, as it contains the image styles and media display modes used throughout the site. Though those are mostly to support templates and the style used by localgov_base.

So we have a different set of image sizes we want to use and set them all to use the same naming convention, and some of the media styles like responive 5:7 don't have reuable names if we're no longer going to include it.

So how safe is it to rename or delete them?

@andybroomfield andybroomfield added the question Further information is requested label Jan 26, 2023
@stephen-cox
Copy link
Member

The config we supply is only for the initial setup. Once installed we don't (at least we shouldn't be) making any assumptions on what still exists, so it should be fine to configure your own media styles and remove the old ones.

The whole media setup in Drupal is pretty complicated, so using you're own and removing the ones supplied might be a little tricky as you untangle the dependencies, fixing display issues and such like,

@ekes
Copy link
Member

ekes commented Mar 13, 2023

The question might more be why are some image styles in here when they are specific to a particular module; and why are image styles named after their configuration rather than their intended use:-

web/modules/contrib/localgov_core/modules/localgov_media/config/optional/image.style.large_21_9_2x.yml:name: large_21_9_2x
web/modules/contrib/localgov_core/modules/localgov_media/config/optional/image.style.large_21_9.yml:name: large_21_9
web/modules/contrib/localgov_core/modules/localgov_media/config/optional/responsive_image.styles.hero_or_banner.yml:    - image.style.large_21_9
web/modules/contrib/localgov_core/modules/localgov_media/config/optional/responsive_image.styles.hero_or_banner.yml:    - image.style.large_21_9_2x
web/modules/contrib/localgov_core/modules/localgov_media/config/optional/responsive_image.styles.hero_or_banner.yml:    image_mapping: large_21_9_2x
web/modules/contrib/localgov_core/modules/localgov_media/config/optional/responsive_image.styles.hero_or_banner.yml:    image_mapping: large_21_9
web/modules/contrib/localgov_paragraphs/modules/localgov_subsites_paragraphs/localgov_subsites_paragraphs.module:      $variables['background_url'] = ImageStyle::load('large_21_9')->buildUrl($file_url);

What is to stop a site wanting its background image to be 21:10 ? Do they then have to have config with the wrong name for the dimensions, or do they have to remove the configuration that is assumed by the module, and is itself not configurable.

Or would it make more sense to make it configurable and ship the image styles with a theme specific module?

@andybroomfield
Copy link
Contributor Author

andybroomfield commented Jan 12, 2024

Noting the config.installer service which is how modules install config, and if we could override this to allow swaping out media / image style IDs during module import.

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

No branches or pull requests

3 participants