Whilst building the new Ixis site in Drupal our content creators were tired of uploading the same image to different fields over and over again. In Drupal 7 we used the media browser provided by the media module so the users can upload an image once and just pick it from the list from then on. So we took the opportunity to look at the state of media module for Drupal 8 and have found it has been reworked quite considerably to be more flexible.
The media browser in media module has been split into multiple components. The ones we are interested in are entity_browser (which "provide a generic entity browser/picker/selector") and File entity browser (file_browser) which "...provides a default Entity Browser that lets you browse and select your files in a nice-looking, mobile-ready Masonry based interface, and upload files using the Dropzonejs module."
We are quite impressed by the experience file entity browser gives out of the box and barring a couple of niggles has worked really well so far.
Below we'll go through the steps of configuring the module along with a couple of customisations we are using that differ to the default.
We'll start at the beginning and step through enabling file entity browser on a field.Installation
Follow the instructions on the file entity browser module page to install file browser. You will need to add the dropzone, masonry and imagesloaded libraries too. You can do this manually or using drush make or composer.Adding file entity browser to a field
Assuming there is a content type with an image field, use "Manage form display" to select the "Entity browser" widget.
You must then configure which entity browser to use. Do this by clicking the settings icon.
You will then be presented with a configuration form - this just needs saving.Using the file browser
In the default configuration, I found the selection process to be a little confusing at first.
Once you have selected the image you are left with the file browser and for me it was not immediately obvious what had happened.
Clicking 'Show selected' shows the image that has been selected in a little popup.
This is so you can build up a list of multiple images to add to the field. These can come from multiple pages of images for example.
Pressing 'Use selected' will add the image to the field.
Once I did it a couple of times it was easy enough, but I found it a little confusing at first. There is an issue on the issue queue related to the this experience.
This "multiple step" behaviour can be changed by configuring the entity browser.
The configuration for entity browsers is at /admin/config/content/entity_browser. The "multiple step" option can be changed using the "Selection display plugin" to "No selection display". This will allow you to pick the image in one step, at the cost of being unable to select multiple images at once. It comes down to personal preference which one you want.Custom Views configuration
The UI for selecting files is based on Views. This means you can quite easily modify the view to display the data you want and also adjust the filters for example.
One of our requirements was to show a drop down for the mime type instead of having to fill it in manually. We wanted to show a selection for Images, Videos and All files. This was configurable using Views.
The mime type field is already an exposed filter, but we want to to change it to a 'Grouped' filter and specify the image mime types for Image group and video mime types for the Video group.
First, select 'Grouped filter'
Then add the groups at the bottom of the page.
This results in a drop down for the mime type when you are using the file browser.Custom entity browsers
It is possible to create your own entity browsers.
For example, you may want to remove the 'mime type' field and only filter by 'application/pdf' to show PDFs only when picking file attachments. You may want to prevent PDF upload too. As you would be changing the view display for this and removing the 'Upload' option you would need a new entity browser to do this.
Unfortunately, the file entity browser will only work for the two entity browsers the module uses. This looks like it may be addressed in a future release.
All in all we've been impressed by the flexibility of the new entity browser system and the file entity browser module.
The future of media is to get more of it in to Drupal core and to standardise the UX of selecting and embedding media. This recent talk at Drupalcon Dublin 2016 explains the roadmap.Video
Dries has recently announced a plan for media management in Drupal 8 core. This expands on the current file entity based approach and expands it to have different media types e.g. Video, Image or Tweet. Initially these will be experimental modules so there could be breaking changes between versions. However, we look forward to trying them out as soon as they land.
Growing up in Essex with my father and most of my friends families working in some capacity for the Ford Motor Company, I tend to gravitate towards the automotive industry whenever I hear people saying we need to look to history in order to see the future. I'm always skeptical about taking this too literally as circumstances change and many new factors are involved - hence why I'm more afraid of an autonomous car controlled by code I'm not allowed to see than a driver whom I can; however sitting here on the eve of the Free/Libre Open Source project Drupal's first anniversary of its latest product release, Drupal 8, I find it hard not to draw parallels between these two industries as I ponder what the future might have to hold.Brass Era Cars 1911 Ford Model T via Wikimedia Commons
According to Wikipedia, 1886 is regarded as the birth year of the modern car, and the 'Brass Era' is an American term for the early period of automotive manufacturing, named for the prominent brass fittings used during this time for such things as lights and radiators. It is generally considered to encompass 1896 through 1915, a time when these vehicles were often referred to as horseless carriages.
Within the 20 years that make up this era, the various experimental designs and alternative power systems would be marginalised. Although the modern touring car had been invented earlier, it was not until Panhard et Levassor's Système Panhard, first built in 1891, was widely licensed and adopted that recognisable and standardised automobiles were created. This system specified front-engined, rear-wheel drive internal combustion engined cars with a sliding gear transmission, and was to become the standard layout for automobiles for most of the next century.
Initially the high-wheel motor buggy (resembling the horse buggy of before 1900) was in its heyday, with over 75 makers, but were only gradually abandoned, in favour of the more advanced runabouts and tonneaus along with other more expensive closed bodies - and killed off by the Ford Model T, first produced by Ford in 1908.Brass Era Web drop.org, which later became Drupal!
The first web browser was invented in 1990 by Sir Tim Berners-Lee, with the first content management system ('CMS') appearing around 1992. Drupal was started in 2000 at a time when there were many CMSs, and although the list of CMSs available is still considerable, there's no doubt that there's a few who dominate the market, with WordPress taking the lion's share; Joomla and Drupal in a battle for 2nd and 3rd spot. If however you only look at larger installations, for example usage in government and education, you'll find Drupal has much larger market share.
Because you can package up functionality in install profiles and distributions much like the Linux operating system, it enables the roll-out of hundreds or even thousands of similar sites, for example Nasdaq's Investor Relations Website Platform, OpenSocial's collaboration platform and the Australian Government's aGov distro. A kind of mass-market production line, one might conjecture.The Parallels
So we have new modes of transport (the car, the web), which quickly have models of manufacture designed for them (Système Panhard, CMSs), of which many different types are made (high-wheeled motor buggies, CMSs), but were gradually abandoned in favour of more advanced runabouts and tonneaus (WordPress, Joomla, Drupal) along with other more expensive closed bodies (SharePoint, SiteCore, Adobe Experience Manager).
The Model T was produced in 1908, 22 years after the birth of the car; Drupal 8 development began in 2011, 21 years after the birth of the web browser. Ford's Model T was not only successful because it provided inexpensive transportation on a massive scale, but also because the car signified innovation for the rising middle class and became a powerful symbol of America's age of modernisation. I'm writing this on a Drupal 8 site which I had the freedom to download, install, and use for free with no license fees, has so far involved me writing no code, and costs me only $10pcm to host on DigitalOcean.From Innovation To Standardisation
During the Brass Era, development of automotive technology was rapid, due in part to hundreds of small manufacturers competing to gain the world's attention, with key developments including electronic ignition systems, independent suspension, and four-wheeled brakes.
In Drupal 8 we've seen Symfony adopted and many modules included into core such as WYSIWYG and Views, making Drupal 8 a great ignition for any web system; Composer increasingly used as Drupal's independent suspension to keep all those dependencies nicely balanced; and as the web calls for speeding up not slowing down, Drupal 8 has the most advanced dynamic cache system of any system, even capable of caching logged in users.Nearing The End
We're now 26 years into the Web - with the Brass Era ending 29 years into the Car does this mean we're nearing the end of the Web CMS Brass Era? What exactly constitutes 'Brass' in terms of Web CMSs?
I draw parallels between Brass and the multitude of modules/plugins and themes for these CMSs. For example, WordPress has many, but they have a much different ecosystem than Drupal's modular architecture which means you can start small and build as your needs arise. WordPress has many paid-for plugins which if you try to get them working together you might encounter issues. Drupal 8's modular system and object-oriented architecture is designed so you can build 100% the system you need, not 90% made up of what someone else thinks you need which has to be nice and shiny in order to grab your attention because they have so many competitors for their shiny lanterns they have for sale.
With WordPress you quickly get into a situation where you have to start writing code to do anything - that's untested, untried code which you'll be tasked with supporting and maintaining. And who is writing this code which operates your core business? With Drupal you've tried and tested modules to use for functionality, along with a 40+ member Drupal Security Team keeping a watchful eye over any security issues which may arise. There's also strict Drupal Coding Standards, and an ethos in the community of working together on similar functionality where possible as opposed to having many plugins doing the same or similar functionality.
I hear people saying "use the right tool for the job", but I don't use different cars for different day-to-day journeys, and most the people I hear it from are techies, not business people who are more focused on the bottom line and just want stuff to be done. Sure, for the edge-cases it's fine, however many businesses share common business functionality so the more that's in the open and shared, the lower the cost of making use of the web will be. Take for example hairdressers, or car dealerships, or life coaches. I see a future filled with many industry-specific Drupal distributions servicing vertical markets. At the moment it's too easy for digital agencies to sell individual solutions and not share, after all, their model is selling people's time, but it won't be long before enterprising entrepreneurs develop more of these distributions focusing on specific verticals, especially now composer support is taking shape more so it's easier to build and maintain these distributions.
For too long many have essentially forked Drupal by downloading it and customising it to the requirements of just the one project at hand, whereas the beauty of Drupal is where you grow the capabilities of Drupal so it does what you want to do without writing code by using modules from core and the world of contrib land. There's a great session from the recent DrupalSouth on YouTube explaining how a decision to "contribute more back" by releasing a module a week, either upgrading existing modules to Drupal 8 or tidying up code from client projects where there was functionality created which more than that one specific requirement needed so could be useful to others turned into a complete new approach to how they develop projects, and their goal for 2017 is to write no custom code at all. This is how it should've been from the start, but there are a number of factors as to why people haven't been approaching Drupal development like this, but going by the number of modules released over the last few weeks for Drupal 8 I believe people are beginning to understand that this entire project was built by sharing, not keeping things secret. I personally believe there needs to be more sharing, and I'd love to speak to any organisation willing to open up their website development project to the world so everyone can have the opportunity to advise on how best to develop it using the modules and methods available, and let's start sharing more so we can grow Drupal's capability more.
So I'm calling it - I believe we'll see Drupal 8 take a dominant lead in the CMS market space over the next three years and go on to be the platform of choice when developing anything for the web. When there's commodity functionality out there available for free, the justification to start paying out for development and/or license fees does not make much sense for the majority of users. Sure, there will always be other systems around - there's custom cars, Formula 1, rally, and so on, but many just want to get from A to B for the minimum cost and minimum fuss, and let's remember the majority of the web is still not using any CMS.
With Drupal 8's ability to work with any device, it's not just publishing for the web but embedding itself in the core of how the internet works, so no matter what you want to do, whether you're the YMCA connecting to workout machines and wearables like FitBit bands or simply thanking your supporters, Drupal 8 can do it!
If you want to find out more about what Drupal could be doing for you, feel free to contact me, and if you're reading this on 19th November 2016, Drupal 8's 1st birthday, there's a fabulous line-up of speakers and sessions for the free Drupal 8 Day Virtual Conference.
Main image of Ford Model A by DougW via Wikimedia CommonsCategory Op-ed Tags Drupal Planet Drupal8 Add new comment
Would you guess that Drupal 8 is already one year old? One of my favorite changes with the Drupal 8.0.0 release was that we also chose to turn to scheduled releases (to happen twice a year) as well as semantic versioning (to allow us to make backwards compatible additions and improvements). That meant that we don't need to wait until Drupal 9 to come out with new exciting things, and indeed, there are various exciting initiatives going on in core right now. Maybe so many that they are hard to follow. So we decided to revive regular posts about core's progress so you can see what is going on and where you may be able to help. And this is not even all the things happening, just a sampling.Default content
The latest incarnation of efforts to get default content into core was kicked off at DrupalCon Dublin. The plan is to create an experimental install profile that contains both a new front-end theme (a separate initiative see below) and example content. It was agreed in Dublin that the theme of the example content will follow the same ‘Farmers Market’ scenario as the Drupal user guide. This creates a lot of synergies and removes both continued argument over what the example content should contain and duplication of work involved in supporting more than one content scenario.
Join the ongoing work in this initiative on the weekly example content meetings happening on Google Hangouts on Air and join the #example-content channel in Drupal Slack. Lee Rowlands has created a sandbox project for the actual Drupal code. The content itself is being iterated on by Keith Jay and several members of his team.Media
The plan for media management was just announced last week. We'll have a sprint in Berlin December 12-16 to kickstart development on some key parts of the initiative. Looking for funding for future sprints and sprinters to join the efforts as well. Help with adding a base entity form implementation to support revisions and implementing the file field redesign with drag and drop support would be helpful immediately though.Multilingual
The multilingual initiative works closely with the migration team recently. The Drupal 7 to 8 core content translation migration is close to being committed and language negotiation settings and language types migrations for both Drupal 6 and Drupal 7 are close to landing as well. Would love to involve more people in migrating i18n and Entity translation module data.New core theme
At DrupalCon New Orleans we kicked off an idea of adding a new theme to Drupal. To address some of the biggest concerns people had over the time about adding themes in core, we decided to work closely with the Default Content initiative.
Currently, the idea issue is in discussion, and before starting to do any further work, we are making sure we are on the same page regarding the key questions.
The PHPUnit initiative was born out of a Drupal 9 discussion what we need to get done before we will open a Drupal 9 Git branch. One goal is to modernize our automated testing system. We are currently using and maintaining a custom version of the Simpletest library which has served as well for many years. In parallel we adopted PHPUnit for our unit tests, but we realized that we can use PHPUnit as a general test runner for our functional tests as well. That means that we do not have to maintain as much test runner code ourselves as we do now.
The workflow initiative was one of the first approved initiative after 8.0.0. The initiative is looking to improve the experience for content authors by improving content workflow and implementing other common patterns that editors are expecting. The plan is split up into multiple phases and in Drupal 8.2 the workflow initiative introduced Content Moderation as an experimental module. In Drupal 8.3 the initiative is planning multiple improvements, including the introduction of Trash module and possibly also components of the Workspace module.
One of the blocking issues that the initiative need help with reviewing is the upgrade between revisionable and non-revisionable entity storage. Any help on this will be much appreciated.
Stay tuned for further updates in December!
In this tutorial, I will explain how to use the Drupal 8 Simple Google Maps module to add a map to your website.
Google has made some the recent changes to the API requests and this tutorial will clarify the process.
Tomorrow is the one year anniversary of Drupal 8. On this day last year we celebrated the release of Drupal 8 with over 200 parties around the world. It's a project we worked on for almost five years, bringing the work of more than 3,000 contributors together to make Drupal more flexible, innovative, scalable, and easier to use.
To celebrate tomorrow's release-versary, I wanted to look back at a few of the amazing Drupal 8 projects that have launched in the past year.1. NBA.com
The NBA is one of the largest professional sports leagues in the United States and Canada. Millions of fans around the globe rely on the NBA's Drupal 8 website to livestream games, read stats and standings, and stay up to date on their favorite team. Drupal 8 will bring you courtside, no matter who you're rooting for.2. Nasdaq
Nasdaq Corporate Solutions has selected Drupal 8 as the basis for its next generation Investor Relations Website Platform. IR websites are where public companies share their most sensitive and critical news and information with their shareholders, institutional investors, the media and analysts. With Drupal 8, Nasdaq Corporate Solutions will be providing companies with the most engaging, secure, and innovative IR websites to date.3. Hubert Burda Media
For more than 100 years, Hubert Burda Media has been Germany's premier media company. Burda is using Drupal 8 to expand their traditional business of print publishing to reach more than 52 million readers online. Burda didn't stop there, the media company also open sourced Thunder, a distribution for professional publishers built on Drupal 8.4. Jurassic World
Drupal 8 propels a wide variety of sites, some of Jurassic proportion. Following the release of the blockbuster film, Jurassic World built its digital park on Drupal 8. Jurassic World offers fans games, video, community forums, and even interactive profiles all of the epic dinosaurs found on Isla Nublar.5. WWF
The World Wide Fund for Nature has been a leading conservation organization since its founding in 1961. WWF's mission is to protect our planet and Drupal 8 is on their team. WWF UK uses Drupal 8 to engage the community, enabling users to adopt, donate and join online. From pole to pole, Drupal 8 and WWF are making an impact.6. YMCA Greater Twin Cities
The YMCA is one the leading non-profit organizations for youth development, healthy living, and social responsibility. The YMCA serves more than 45 million people in 119 countries. The team at YMCA Greater Twin Cities turned to Drupal 8 to build OpenY, a platform that allows YMCA members to check in, set fitness goals, and book classes. They even hooked up Drupal to workout machines and wearables like Fitbit, which enables visitors to track their workouts from a D8 powered mobile app. The team at Greater Twin Cities also took advantage of Drupal 8's built-in multilingual capabilities so that other YMCAs around the world can participate. The YMCA has set a new personal record, and is a great example of what is possible with Drupal 8.7. Jack Daniels
The one year anniversary of Drupal 8 is cause for celebration, so why not raise a glass? You might try Jack Daniels and their Drupal 8 website. Jack Daniels has been making whiskey for 150 years and you can get your fill with Drupal 8.8. Al Jazeera Media Network
Al Jazeera is the largest news organization focused on the Middle East, and broadcasts news and current affairs 24 hours a day, 7 days a week. Al Jazeera required a platform that could unify several different content streams and support a complicated editorial workflow, allowing network wide collaboration and search. Drupal 8 allowed Al Jazeera to do that and then some. Content creators can now easily deliver critical news to their readers in real time.9. Alabama.gov
From Boston to LA and even Australia, Drupal is supporting the digital needs of governments around the globe. Alabama is leading the way with Drupal 8. Alabama.gov puts its citizens first, and demonstrates how open source can change the way the public sector engages online.10. Box
Box has been a leader in the technology industry since its founding in 2005. Box takes advantage of Drupal 8 and the improved features made available right out-of-the-box. Bad puns aside, companies like Box are using Drupal 8's new features and improved user interface to build the best digital experiences yet.11. Habitat for Humanity
The historic nonprofit Habitat for Humanity doesn't just build houses for those in need; they build habitat.org on Drupal 8. Habitat for Humanity provides affordable housing for communities in over 70 countries around the world. You can discover their impact through the "Where we Build” interactive map, donate, and volunteer all on their Drupal 8 site.12. Obermeyer
Obermeyer and Drupal 8 will take you into new territory. The ski wear company offers seamless end to end commerce integration, providing both new and loyal customers a great shopping experience. Let Obermeyer's Drupal 8 integration with Drupal Commerce keep you warm because winter is coming ...Happy 1st birthday Drupal 8!
I can't think of a better way to celebrate Drupal 8's one year anniversary than by sharing some incredible experiences that are being created with Drupal 8. Whether the project is big or small, features dinosaurs, or spreads awareness for an important cause, I'm proud to say that Drupal 8 is supporting an amazing array of projects. In my recent keynote at DrupalCon Dublin, I explained why the why of Drupal is so important. After one year of Drupal 8, it's clear how powerful our collective purpose, projects, and passions can be.
Thank you to everyone who has continued to contribute to Drupal 8! I can't wait for another year of exciting projects. Special thanks to Paul Johnson for crowdsourcing great examples that I wouldn't have known about otherwise.