Skip to content
Menu
Open World News Open World News
  • Privacy Policy
Open World News Open World News

Category: News

Newcomers, trustworthiness, and privacy: priorities from the Japanese Wikipedia community

Posted on June 20, 2024 by Michael G
The Wikimedia Foundation develops an Annual Plan every year, where we outline our key goals and priorities and explain the work we will set out…

Mario Hernandez: Managing image embeds with Drupal media

Posted on June 20, 2024 by Michael G

Allowing your content creators to embed images in text fields is a big risk if you don’t have the right measures in place to get properly rendered images without jeopardizing your site’s performance. We faced this issue first-hand with embedded images due to not using the right configuration and this lead to extremely large images being rendered. In this post I’ll go over the techniques I took for addressing those issues and set up a system for image embeds that is solid and performant.

I started by writing a seven-part guide on how to setup responsive images. In this post I’ll focus on image embeds. If you followed or read the responsive images guide, you should be able to take advantage of some of the work we did there in this post. The guidelines covered here include:

  • Defining requirements
  • Image styles
  • Media view modes
  • Text format configuration

Defining requirements

Before you write the first line of code or set the first drupal configuration for this issue, you need to have a clear understanding of your requirements. Here is a summary of my requirements:

  • Only certain user roles can embed images

    This means we need to figure out if the text formats used in our site will allow us to set the restrictions we need. Otherwise we may need to create or edit a text format for our target user roles.

  • Users need to be able to choose the image size and aspect ratio when embedding images

    We defined the image sizes and aspect ratios and assigned names that were user-friendly for non-technical users. We came up with name options we think our users will find easy to work with such as:

    • Small square, Small portrait, Small rectangular
    • Medium square, Medium portrait, Medium rectangular, Medium rectangular wide
    • Large square, Large rectangular, Large rectangular wide
    • Extra large square, Extra large rectangular, Extra large rectangular wide
  • If no option is selected by users, set a default image size

    For the default option when no selection is made by the user, we decided to use the Medium rectangular option. This has an aspect ratio of 3:2 and it measures about 720×480.

  • Existing Media items need to be available for embedding

    This was a tricky one because my original inclination was to create a new Media type so we can isolate all configuration for its view modes and not overpopulate our default Media type. However, this ended up not working for us because when you limit your image embeds to only use a new Media type, you don’t get access to any of the media items (images), that have already been uploaded to the Media library using other media types. Ultimately we ended up using Drupal core’s Media type, Image, and our dev team had to compromise on having a very busy list of view modes for this media type.

  • Images need the ability to be cropped wihin the Media page

    Since most of our images already provide the ability to be cropped at different aspect ratios, using the core Media type in the previous bullet point made this an easy solution.

Image styles

It all starts with image styles. I’m not going to go over how to create image styles, you can read my post Image styles in Drupal. The one thing I am going to repeat however is the importance of creating reusable image styles. Reusable image styles can help you reduce the number of image styles you create while providing the flexibility you need with each use case.

Image styles are key as each of the size options we defined above translate into image styles. So Small square for example, is an image style that is defined as 1:1 (250px). Medium rectangular would be something like 3:2 (720x480), etc. You may be wondering, how do you plan on using fiendly names for your content editors when your image styles names are not very friendly? Great question. Since we are using Drupal’s Media, content editors do not interact directly with image styles, they do with Media view modes and this is where we will use more friendly names.

Media view modes

View modes are one of Drupal’s powerful features. Being able to display content is different ways with little effort can turn a simple website into a dynamic content hub. The example I always give when someone asks me what view modes are or how do they work is the Amazon website. When you are viewing a product in amazon.com, or most retail websites for that matter, you will notice that the same product or similar ones appear all over the page but in slightly different ways, with different fields or styles. See the page below for an example.

Mario Hernandez: Managing image embeds with Drupal media

The image above shows many ways in which a product can be displayed. I’ve numbered each display.

In Drupal, every entity such as content types, media types, blocks, etc., offer the ability to create view modes. For the purpose of image embeds, we will create a Media type view mode for each image style we plan on using. The view modes is what content editors will interact with when choosing an image size or aspect ratio during the image embed process. This is where we will use the user-friendly names we defined earlier. Let’s go over how this relationship between view modes and image styles works for image embeds.

Configure view modes for the Image media type

  1. In your Drupal site, create an image style for each image size option you wish to provide to users when embedding images.

  2. Next, create a Media view mode for each image style (/admin/structure/display-modes/view). Very iimportant: Remember the view mode’s label (name) is where we are going to use the friendly name (i.e. Medium rectangular (720×480)). I like to keep the machine name similar to the label so it’s easier to debug or identify in code (i.e. medium_rectangular_720x480).

  3. Now, let’s tie 1 & 2 together:

    • Go to the media type you plan on using for media embeds (/admin/structure/media/manage/image/display). I am using Drupal core’s Image media type.
    • Scroll down and expand the Custom display settings fieldset.
    • Check each of the view modes you created in step 2 and click Save.
  4. Now click each of the view modes and update the image field to use the respective/matching image style.

Configure the text format

View modes and image styles are all configured. Now let’s configure the Text format that authorized users will use to embed images.

  1. Go to the Text formats and editors page (/admin/config/content/formats)
  2. Click Configure next to the text format you plan on using (i.e. Full HTML)
  3. Ensure the right user roles are selected
  4. Within the Toolbar configuration section, drag the Drupal media button from the Available buttons options to the Active toolbar section. You could probably remove the original insert image button since you won’t be using it.
  5. Scroll to the Enabled filters section and check the Embed media checkbox
  6. Scroll to the Filter settings section and set the following:
    • Default view mode: This is the default display that will be used if content editors don’t pick an option when embedding images. Select any of the view modes that represents the image size you want to use as default.

    • Media types selectable in the Media Library: Select the Media type you plan on using. In my case is Image.

    • View modes selectable in the ‘Edit media’ dialog: Finally, select each of the view modes you created in the previous section. FYI: View modes will be sorted in alpha order by their machine name. In my case I had to prefix some of the machine names with either “a” or “b” so the list of options for the users to choose from would be nicely organized by their label name. See screnshot below.

    • Click Save configuration

Testing your configuration

Now that we’ve completed all the configuration we should be able to take it for test drive.

  • Go to any page where there is a text field with a WYSIWYG editor
  • Make sure you are using the right text format by selecting it at the bottom of the text field where you want to embed an image
  • Click the Insert media button from the editor’s toolbar
  • Select or upload the image you’d like to embed
  • When the image has been inserted, click on it and you should see several options of actions you can do with the image. Things like align the image, add a caption, link it, and you should also see a selection box listing all the view modes you created.
  • After making your selection you should immediately see the image size/aspect ratio change to the one you selected. When you are happy with your selection, click the Save button to save your page.

Important: Depending on your site’s configuration, the options for changing your image size may look different than mine. In my case, I am only using Drupal’s core modules and this is how the options look for me:

Example of image embed editor options

In closing

Putting a system like this for your image embeds will give you the piece of mind that content editors have options to choose how big or small they would like images to be displayed, and from a performance point of view, if your image styles are done properly, you can rest assurred that bloated images will never be rendered because you have put the guard rails in place to avoid this from happening.

I hope you found this article useful and can put these techniques to use in your own Drupal project. Happy New Year! šŸŽ‰ šŸŽŠ šŸŽ† šŸ‘‹

command_kit 0.6.0 released

Posted on June 20, 2024 by Michael G
Released command_kit 0.6.0.

OpenBSD added initial support for Qualcomm Snapdragon Elite X after 1 day

Posted on June 20, 2024 by Michael G
When a new processor is released, how long would you expect it to take before your favorite operating system adds support for it?

In the case of OpenBSD/arm64, the time lag can occasionally be measured in days if not hours.

In a recent message to tech@, Patrick Wildt (patrick@) premiered the patch to add support for the Qualcomm Snapdragon Elite X processor the day after it was officially released.

Patrick’s message reads,

List:       openbsd-tech
Subject:    Qualcomm Snapdragon X Elite minimal support
From:       Patrick Wildt <patrick () blueri ! se>
Date:       2024-06-19 20:28:08

Hi there,

the Qualcomm Snapdragon Elite X machines were released yesterday, I got
a Lenovo Yoga Slim 7 today, and it's already booting up with working
NVMe, USB and keyboard.  Wonder if I beat my last record.

Read more…

The ExectOS operating system

Posted on June 20, 2024 by Michael G
ExectOS is a preemptive, reentrant multitasking operating system that implements the XT architecture which derives from NT architecture. It is modular, and consists of two main layers: microkernel and user modes. Its’ kernel mode has full access to the hardware and system resources and runs code in a protected memory area. It consists of executive services, which is itself made up on many modules that do specific tasks, a kernel and drivers. Unlike the NT, system does not feature a separate Hardware Abstraction Layer (HAL) between the physical hardware and the rest of the OS. Instead, XT architecture integrates a hardware specific code with the kernel. The user mode is made up of subsystems and it has been designed to run applications written for many different types of operating systems. This allows us to implement any environment subsystem to support applications that are strictly written to the corresponding standard (eg. DOS, or POSIX). Thanks to that ExectOS will allow to run existing software, including Win32 applications. ↫ ExectOS website What ExectOS seems to be is an implementation very close to what Windows NT originally was – implementing the theory of Windows NT, not the reality. It’s clearly still in very early development, but in theory, I really like the idea of what they’re trying to achieve here. Windows NT is, after all, in and of itself not a bad concept – it’s just been tarred and feathered by decades of mismanagement from Microsoft. Implementing something that closely resembles the original, minimalist theories behind NT could lead to an interesting operating system for sure. ExectOS is open source, contains its own boot loader, only runs on EFI, and installation on real hardware, while technically possible, is discouraged.

New Google app ā€˜takes stress out of holiday packing’

Posted on June 19, 2024 by Michael G

Author: Source Read more

Allah o akbar

Posted on June 19, 2024 by Michael G
Welcome to my channel
This channel is releated about disabled peoples who are special in this world i can feel their pains bcoz same condition as like me . May God bless them and motivated each of them that they can do everything like as others. They have skills more and more and it is given by God so dont worry ! Disabled peoples are diamonds on earth bcoz they have pure heart paid $1 or $2 in payeer account P1104476522 remember me in your prayers & subscribe / share my chAnnel thankyou.
There is lots of fun on my channel plz subscribe and like it have fun and enjoy with lots of laughter

Previa 2ĀŖ ronda Open de Australia – MARSHALL THE WOLF

Posted on June 19, 2024 by Michael G

Author: Source Read more

Century Regalia: Luxury Apartments with Extensive Amenities in East Bangalore

Posted on June 19, 2024 by Michael G
Experience unparalleled luxury at Century Regalia, an upscale residential development near Indiranagar, East Bangalore. This prestigious project spans 4 acres and comprises 300 high-end apartments in stylish towers.
https://accounts.eclipse.org/users/centuryregaliaa
https://www.prodesigns.com/wordpress-themes/support/users/centuryregaliaa
https://world.optimizely.com/System/Users-and-profiles/Community-Profile-Card/?userId=f878177c-af7b-4543-a961-2a26047285e5
https://www.blurb.com/user/centuryregal
https://www.instructables.com/member/centuryregaliaa/
https://creativemarket.com/users/centuryregaliaa
https://id.arduino.cc/
https://active.popsugar.com/@centuryregaliaa/profile
https://www.pixiv.net/en/users/107171169
https://participer.ge.ch/profiles/psouthernstars/activity
https://ko-fi.com/psouthernstars
https://grapedrop.com/s/751652c997b34bd3a25511071c17393e
https://paizo.com/people/psouthernstars

Wikimedia Hackathon 2024: Good Projects and Good People!

Posted on June 19, 2024 by Michael G
The 2024 Wikimedia Hackathon, held from May 3rd – 5thĀ  in Tallinn, Estonia, brought together a highly technical group of enthusiastic participants from around the…
  • Previous
  • 1
  • …
  • 202
  • 203
  • 204
  • 205
  • 206
  • 207
  • 208
  • …
  • 821
  • Next

Recent Posts

  • [TUT] LoRa & LoRaWAN – MikroTik wAP LR8 kit mit The Things Network verbinden [4K | DE]
  • Mercado aguarda Powell e olha Trump, dados e Haddad | MINUTO TOURO DE OURO – 11/02/25
  • Dan Levy Gets Candid About Learning How To Act Differently After Schitt’s Creek: ā€˜It’s Physically…
  • Building a Rock Shelter & Overnight Stay in Heavy Snow šŸ•ļøā›°ļø
  • Les milliardaires Elon Musk et Xavier Niel s’insultent copieusement

Categories

  • Android
  • Linux
  • News
  • Open Source
©2025 Open World News | Powered by Superb Themes
We use cookies on our website to give you the most relevant experience by remembering your preferences and repeat visits. By clicking ā€œAccept Allā€, you consent to the use of ALL the cookies. However, you may visit "Cookie Settings" to provide a controlled consent.
Cookie SettingsAccept All
Manage consent

Privacy Overview

This website uses cookies to improve your experience while you navigate through the website. Out of these, the cookies that are categorized as necessary are stored on your browser as they are essential for the working of basic functionalities of the website. We also use third-party cookies that help us analyze and understand how you use this website. These cookies will be stored in your browser only with your consent. You also have the option to opt-out of these cookies. But opting out of some of these cookies may affect your browsing experience.
Necessary
Always Enabled
Necessary cookies are absolutely essential for the website to function properly. These cookies ensure basic functionalities and security features of the website, anonymously.
CookieDurationDescription
cookielawinfo-checkbox-analytics11 monthsThis cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Analytics".
cookielawinfo-checkbox-functional11 monthsThe cookie is set by GDPR cookie consent to record the user consent for the cookies in the category "Functional".
cookielawinfo-checkbox-necessary11 monthsThis cookie is set by GDPR Cookie Consent plugin. The cookies is used to store the user consent for the cookies in the category "Necessary".
cookielawinfo-checkbox-others11 monthsThis cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Other.
cookielawinfo-checkbox-performance11 monthsThis cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Performance".
viewed_cookie_policy11 monthsThe cookie is set by the GDPR Cookie Consent plugin and is used to store whether or not user has consented to the use of cookies. It does not store any personal data.
Functional
Functional cookies help to perform certain functionalities like sharing the content of the website on social media platforms, collect feedbacks, and other third-party features.
Performance
Performance cookies are used to understand and analyze the key performance indexes of the website which helps in delivering a better user experience for the visitors.
Analytics
Analytical cookies are used to understand how visitors interact with the website. These cookies help provide information on metrics the number of visitors, bounce rate, traffic source, etc.
Advertisement
Advertisement cookies are used to provide visitors with relevant ads and marketing campaigns. These cookies track visitors across websites and collect information to provide customized ads.
Others
Other uncategorized cookies are those that are being analyzed and have not been classified into a category as yet.
SAVE & ACCEPT