![]() ![]() ![]() Content authoring -> Text formats and editorsĬlick "Configure" for the text format (such as Full HTML), scroll down to the "CKEditor plugin settings" section, and there you can uncheck "Enable image uploads". I can edit the html source in ckeditor and add "align-left" to the class list, for example, if I want it to float left, When I insert a medium style image, in the image tag, it adds If you need to change it for one or more images, you have to either change the default class in the insert module settings, or switch to source mode in ckeditor and edit the class name to an alternate class you have defined in css_injector.įor example, in the insert module configuration page, in the field labeled "classes to be added to images and image links", I configured it to add class "inline-image". The Insert module allows you to configure a custom class that will be added to all images you insert, so you can set that and then style it in css_injector, which gives you default image styling. Using the insert module with the image field You can add CSS for those classes to add margins and/or borders. The button, based on your selected alignment option, adds a property of data-align="right|left|center" (if you select an alignment other than 'none'), which adds a class of "align-left", "align-right", or "align-center" on the final output. The other annoying thing about this button is that you have no way to browse the local server to use an already uploaded image. The default ckeditor image button allows you to set image alignment, but they have removed all other settings that were available in Drupal 7, such as border or space around the image. I tried enabling the Styles button in ckeditor, but it will not let you define CSS classes for images for some weird reason. These methods are not ideal but workable and not too painful.Īll of this is based on utilizing css_injector, from the asset_injector module, so that no code changes have to be made to any theme files or modules. As of Drupal 8.4.5, since ckeditor has been crippled, these are the most simple methods I could come up with to style inline images in my content, such as wrapping text and/or adding borders and margins around them. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |