Set default image alignment

Created on 16 March 2023, almost 2 years ago
Updated 30 June 2023, over 1 year ago

As I am mostly always using the same alignment for images, it would increase productivity if I can configure a default alignment that is pre-selected. In this way I would only need to click the insert button.

Feature request
Status

Fixed

Component

Code

Created by

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @sd123
  • Thanks for using the Insert module. You could try to just overwrite insert-button-widget.html.twig, putting a copy of the file into your backend theme's folder and moving the checked attribute to your desired default radio input. That could already do the trick.

    If there was a module or field setting for it, it would not work much differently, just that the setting would then be injected into the template file instead of having to overwrite template. If overwriting the template works, I would suggest using that method for now rather than adding a setting as this is so far the first time the feature is requested.

  • Status changed to Needs review over 1 year ago
  • Having a bit of time to try this out, it does not work just out of the box unfortunately. But I have attached a patch set that would achieve being able to use the way I described in the previous message. Using the patch, I can simply copy insert-button-widget.html.twig into my backend theme's folder and move the checked attribute to another radio button which would then be the default alignment.
    If there is no custom backend theme yet, creating a sub theme is pretty straight forward: https://www.drupal.org/docs/theming-drupal/creating-sub-themes

    • Snater committed 9208bbe0 on 8.x-2.x
      Issue #3348398 by Snater: Set default image alignment
      
  • Status changed to Fixed over 1 year ago
  • Automatically closed - issue fixed for 2 weeks with no activity.

Production build 0.71.5 2024