Drupal Planet

Syndicate content
Drupal.org - aggregated feeds in category Planet Drupal
Updated: 9 hours 13 min ago

Tim Millwood: Programmatically install Drupal 8 module

Mon, 2017-05-15 23:41
Programmatically install Drupal 8 module timmillwood Tue, 16/05/2017 - 07:41

There are times, often in tests or upgrade paths, where we want to programmatically install a module. Here's how:

\Drupal::service('module_installer')->install(['workspace']);

Tags drupal-planet drupal drupal 8 Add new comment
Categories: Drupal

Agiledrop.com Blog: AGILEDROP: Third European Drupal Business Days with Agiledrop

Mon, 2017-05-15 21:52
In the last blog post, we revealed that our development team will be present at Drupal Heart Camp Zagreb. But that won't be the only Drupal Event, where Agiledrop will be present at the end of this week. Namely, Marko Bahor and Iztok Smolic (our Commercial and Operations directors) will attend European Drupal Business Days in Frankfurt. That means that you'll be able to talk to us in person in two different locations across Europe, practically at the same time. From 19th to 21st May up to ten of our team member will be in Zagreb. On the other hand, Marko and Iztok will travel a little… READ MORE
Categories: Drupal

Evolving Web: How to Make Sure Your Content Editors Love Drupal

Mon, 2017-05-15 11:32

I train a lot of new Drupal users. Some find it easy-to-use and some find it a daunting maze of forms full of confusing terminology. Sometimes, it just depends on how the admin UI has been configured.

Here are some tips for configuring Drupal so that content editors using your site will love Drupal!

Give Editors Limited Permissions

Often users are overwhelmed by the number of things they can do once they're logged into Drupal. If you take the time to update their permissions and remove un-needed permissions, the administrative interface will be much simpler to use. Content editors probably don't need to modify image styles or manage view modes, so don't give them these permissions.

This is probably to single most important thing you can do to improve the admin UI, and has the added bonus of making your site more secure. It also makes it harder to for editors to break the site by accident by changing a setting they don't understand.

Configure the WYSIWYG Editor

One of the exciting things about Drupal 8 is that the WYSIWYG editor is built-in. But Drupal doesn't know out-of-the-box what HTML you have and who your editors are. That's why you can and should customize the WYSIWYG editor (Configuration > Content Authoring > Text formats and editors).

You can remove unneeded tools and add ones that are really useful (like Paste from Word and Paste as Plain Text). You can also configure the "Styles" and "Format" options that users can add from the WYSIWYG editor. 

Text Formats

Text formats are one of the keys to content editing success. Remember that text formats are associated with permissions, so your content editors will need to permission to use any given text format. They are also associated with content. If I save a piece of content using Full HTML, the next user who edits the content will also need permission to use that text format. Otherwise, they the text field will be disabled.

So make sure that your content editors have permission to edit all the text formats that will be associated with content that they need to edit.

Field Configuration

The more that you break up your content into nice, manageable fields, the more consistently you can collect and display content on your site. If your content editors are used to one large text box where they enter content on the page, they might not be so excited at first about a set of separate fields. So here are some tips to configuring fields so content editors will like them:

  • Make sure you're using the right field widget. Should you be using an autocomplete instead of a select box? Check out the widget settings on the Manage Form Display tab. 
  • Use help text when needed, especially if you need content in a certain format, or a particular image size.
  • Make required fields required. Don't make your content editors guess what's required for the content to look right.
  • When appropriate, add a default value.
  • Make sure the order of the fields in the admin UI makes sense, and is consistent across different types of content.
  • If you have nested Paragraph fields in your content, try changing the widget to display a preview of each one, instead of an edit form.
Content Type Configuration

Make it easy for content editors to pick the right content type by providing meaningful names and descriptions. Think of this as built-in documentation. Make sure you create different content types for distinct types of data, rather than using catch-all content types. At the same time, don't set up multiple content types with identical fields, since this will add to the administrative overhead of the site. Remember, you can always use taxonomy terms to distinguish different ways that content should be filtered/displayed on the site.

Hide the Cruft

There are lots of elements in the Drupal node edit page, like the 'Sticky at top of lists' checkbox, that can be easily hidden. If you're not using these settings, or if there are legacy fields that are no longer relevant, hide them! It's easy to hide fields from the edit form using the 'Manage Form Display' tab.

Preview

For those of you who haven't tried the Preview button for Drupal 8, it works a whole lot better than it did in Drupal 7. Your content editors might find this really useful. If you're using View Modes to control the display of content in different contexts throughout the site, you'll probably need to provide some documentation/instructions for you content editors, prompting them to switch the view mode when they're previewing.

Edit a Page with One Click

Ideally, content editors would be able to edit the main content of a page via a single 'Edit' link. If you're creating landing pages that have complex content, this can be difficult. You might be storing some of the page elements as blocks or related nodes.

You can use Paragraphs to set up compound content that's specific to the landing page, or use the Inline Entity Form module to allow users to edit content that's referenced from within your page, and displayed elsewhere on the site.

Create Dashboards or Custom Admin Views

Content editors like to have a landing page they can go to to see the overall state of content on the site. This might take the form of a dashboard, or it might be a series of customized content listing pages (which you can easily build with views). The idea is to give content editors an easy way to search and edit the content, as well as links to the admin pages they'll need most often.

Contrib Modules for Content Editing

The LinkIt module provides a nice interface for inserting links that your content editors will really appreciate.

The media management modules Entity Browser and File Entity Browser together to provide easy file-reuse. This is a usability win for content editors who are working with large libraries of files.

Use Field Group to group related fields together in the content admin UI.

Test

You need to test your content admin UI. Test what it looks like for different types of users. The Masquerade module can help with this. Make sure your list of tests include editing different types of content, making sure that any content that's migrated into Drupal can be edited consistently.

All of this is a lot of work, not a task to do the day before site launch. It's best to start thinking about the content admin experience the day you start building your site.

If you liked this blog post and want more step-by-step tips for setting up your Drupal 8 website, we have several Drupal trainings coming up online and in-person that you might like.

+ more awesome articles by Evolving Web
Categories: Drupal

Dries Buytaert: Think beyond with Acquia Labs

Mon, 2017-05-15 11:18

For most of the history of the web, the website has been the primary means of consuming content. These days, however, with the introduction of new channels each day, the website is increasingly the bare minimum. Digital experiences can mean anything from connected Internet of Things (IoT) devices, smartphones, chatbots, augmented and virtual reality headsets, and even so-called zero user interfaces which lack the traditional interaction patterns we're used to. More and more, brands are trying to reach customers through browserless experiences and push-, not pull-based, content — often by not accessing the website at all.

Last year, we launched a new initiative called Acquia Labs, our research and innovation lab, part of the Office of the CTO. Acquia Labs aims to link together the new realities in our market, our customers' needs in coming years, and the goals of Acquia's products and open-source efforts in the long term. In this blog post, I'll update you on what we're working on at the moment, what motivates our lab, and how to work with us.

Alexa, ask GeorgiaGov

One of the Acquia Labs' most exciting projects is our ongoing collaboration with GeorgiaGov Interactive. Through an Amazon Echo integration with the Georgia.gov Drupal website, citizens can ask their government questions. Georgia residents will be able to find out how to apply for a fishing license, transfer an out-of-state driver's license, and register to vote just by consulting Alexa, which will also respond with sample follow-up questions to help the user move forward. It's a good example of how conversational interfaces can change civic engagement. Our belief is that conversational content and commerce will come to define many of the interactions we have with brands.

The state of Georgia has always been on the forefront of web accessibility. For example, from 2002 until 2006, Georgia piloted a time-limited text-to-speech telephony service which would allow website information and popular services like driver's license renewal to be offered to citizens. Today, it publishes accessibility standards and works hard to make all of its websites accessible for users of assistive devices. This Alexa integration for Georgia will continue that legacy by making important information about working with state government easy for anyone to access.

And as a testament to the benefits of innovation in open source and our commitment to open-source software, Acquia Labs backported the Drupal 8 module for Amazon Echo to Drupal 7.

Here's a demo video showing an initial prototype of the Alexa integration:

Shopping with chatbots

In addition to physical devices like the Amazon Echo, Acquia Labs has also been thinking about what is ahead for chatbots, another important component of the conversational web. Unlike in-home devices, chatbots are versatile because they can be used across multiple channels, whether on a native mobile application or a desktop website.

The Acquia Labs team built a chatbot demonstrating an integration with the inventory system and recipe collection available on the Drupal website of an imaginary grocery store. In this example, a shopper can interact with a branded chatbot named "Freshbot" to accomplish two common tasks when planning an upcoming barbecue.

First, the user can use the chatbot to choose the best recipes from a list of recommendations with consideration for number of attendees, dietary restrictions, and other criteria. Second, the chatbot can present a shopping list with correct quantities of the ingredients she'll need for the barbecue. The ability to interact with a chatbot assistant rather than having to research and plan everything on your own can make hosting a barbecue a much easier and more efficient experience.

Check out our demo video, "Shopping with chatbots", below:

Collaborating with our customers

Many innovation labs are able to work without outside influence or revenue targets by relying on funding from within the organization. But this can potentially create too much distance between the innovation lab and the needs of the organization's customers. Instead, Acquia Labs explores new ideas by working on jointly funded projects for our clients.

I think this model for innovation is a good approach for the next generation of labs. This vision allows us to help our customers stake ground in new territory while also moving our own internal progress forward. For more about our approach, check out this video from a panel discussion with our Acquia Labs lead Preston So, who introduced some of these ideas at SXSW 2017.

If you're looking at possibilities beyond what our current offerings are capable of today, if you're seeking guidance and help to execute on your own innovation priorities, or if you have a potential project that interests you but is too forward-looking right now, Acquia Labs can help.

Special thanks to Preston So for contributions to this blog post and to Nikhil Deshpande (GeorgiaGov Interactive) and ASH Heath for feedback during the writing process.

Categories: Drupal

DrupalCon News: Get Ready for DrupalCon Nashville

Mon, 2017-05-15 08:51

As we conclude DrupalCon North America for 2017, it is with great excitement that we officially invite you to join us at DrupalCon Nashville! To stay notified on key dates, registration opening and call for papers leave us your email address and name here. Don’t forget to check the option for DrupalCon News under My Email Subscriptions to stay notified on the latest DrupalCon News.

Categories: Drupal

Drupal core announcements: Drupal core security release window on Wednesday, May 17, 2017

Mon, 2017-05-15 07:02
Start:  2017-05-17 12:00 - 17:00 America/New_York Organizers:  xjm catch David_Rothstein stefan.r cilefen Event type:  Online meeting (eg. IRC meeting)

The monthly security release window for Drupal 8 and 7 core will take place on Wednesday, May 17.

This does not mean that a Drupal core security release will necessarily take place on that date for any of the Drupal 8 or 7 branches, only that you should watch for one (and be ready to update your Drupal sites in the event that the Drupal security team decides to make a release).

There will be no bug fix or stable feature release on this date. The next window for a Drupal core patch (bug fix) release for all branches is Wednesday, June 07. The next scheduled minor (feature) release for Drupal 8 will be on Wednesday, October 5.

For more information on Drupal core release windows, see the documentation on release timing and security releases, and the discussion that led to this policy being implemented.

Categories: Drupal

ThinkShout: What to Think About When You're Thinking About a Redesign

Mon, 2017-05-15 06:30

Websites, like most things, have a lifespan. At first, they are new and shiny and aligned with both your organization’s goals and current web trends and best practices. As time goes on, however, technology continues to progress, and your organizational goals will probably evolve as well.

If you’ve worked through a full Discovery process to develop an information architecture that supports your organization’s core mission, then all you may need to update is the look and some of the site content. But if you haven’t engaged in an in-depth Discovery process before, you may find that your site is not only technically outdated, but also no longer reflects who you are as an organization.

So it’s time to think about a redesign. The good news is, starting your new project with a full Discovery will help you create a site structure that will serve your needs not just for the new version of the site, but for years to come. Additionally, if you build your new site on a widely-used and well-supported open source CMS platform (like Drupal or Wordpress), you won’t need to switch systems every couple of years. For example, Drupal 8, the latest version of Drupal, is expected to have a lifespan of 8-10 years.

Investing time and energy to develop a strong foundation now will set you up for success in the future. But how can you ensure your website redesign gets off to the right start?

Here at ThinkShout, we believe that technical excellence and award-worthy design should be a given, and that our focus should be on building you a site that helps you connect with your constituents and meet your goals. Through numerous discovery engagements with many different organizations, we’ve uncovered some key questions to ask during the initial requirements gathering phase that will help ensure the solution we create meets your needs and serves your mission.

Here are some things to think about when you’re thinking about a redesign:

What are Your Organizational Goals?

Before you dive into the specifics of your website, let’s take a step back and think at a higher level. Defining your organizational goals will help make sure that the solution you and your vendor create not only looks good and functions well, but will also support the fundamental mission of your organization.

So it’s important to take a moment to think about what your organization’s goals are. What issue are you working to address? What does success for your organization look like? The more specific and measurable these goals are, the better. Measuring your progress towards your higher level goals can help you assess the success of your project.

What are Your Project Goals?

Now it’s time to zoom in and focus on this project itself. Project goals should be tangible, attainable, and measurable. They may include a mixture of internal goals (perhaps relating to how you are able to manage the website) and external goals (how your users interact with the website: engagement, donations, tracking, etc.).

It may be helpful when thinking about your project goals to determine how they relate to your organizational goals. Can you map your project goals to the organizational goals they support? If not, perhaps you should consider if that particular goal for the project is even necessary – or if it can be deprioritized.

For example, if your organization is a local animal shelter, one of your organizational goals may be to increase pet adoption. Website project goals that support this higher-level goal might be to post profiles for adoptable pets online, or allow facilitate adoptions through your website.

Identifying and then prioritizing your project goals may also help you define what success will look like for your redesign project. How will you measure progress towards these goals? Which goals need to be met for the project to be successful?

Who are Your Audiences?

A website only adds value for your organization if your audiences use it, and mostly people will come to your website looking for information, driven by their own needs and motivations. If you focus primarily on your goals, you may end up with a website that is geared towards your organization’s needs and structures, but that does not allow your users to easily access the information they seek.

Defining who your audiences are will allow you to put your users first when redesigning your website. Once you know who your audiences are, you can determine what content will satisfy their needs, sparking the trust that will allow you to nudge them to take an action beneficial to you.

These questions are just a starting place for your website redesign. A full discovery process will delve more deeply into your programs and departments, your needs and wants, and what makes your organization tick. But asking yourself these three questions before you start will help give you an anchor to help you ensure that your new website engages your users and supports your mission.

Categories: Drupal

Code Positive: Drupal - Making Websites Flexy!

Mon, 2017-05-15 00:45

Drupal’s strength lies in its versatility, or, as we happen to mention a few times in this article..... its flexibility.

READ MORE

 

Categories: Drupal

Blair Wadman: Step by step guide to creating an admin form in Drupal 8

Fri, 2017-05-12 09:32

Creating an admin form is often one of the first things you'll need to do in a custom Drupal module. An admin interface enables you to make a module's settings configurable by a site editor or administrator so they can change them on the fly.

Categories: Drupal

Valuebound: Drupal Coding Standards and Best Practices

Fri, 2017-05-12 06:16

The work of a code is not just to execute a command but to make sure that it can be edited, updated and debugged.

When you first write a code in a language you prefer to write in your comfort level. However, a good code should always adhere to the standards of coding to ensure readability. And maintainability.

There are some particular areas where the members of a team might often have different preferences but will need to agree on something. It's a tough debate about the advantages and disadvantages any system over another. But being consist on a lot of these things have a large impact and advantage rather than being inconsistent: all of the members can read the code and that ensures one part  can be used…

Categories: Drupal

Third & Grove: Webinar: How Quicken is Disrupting Digital with Magento and Drupal

Fri, 2017-05-12 06:00
Webinar: How Quicken is Disrupting Digital with Magento and Drupal antonella Fri, 05/12/2017 - 09:00
Categories: Drupal

Promet Source: We're heading to Texas Camp, ya'll! Will you be there?

Fri, 2017-05-12 04:33
We're packing our bags and heading south - way south for what is sure to be a weekend jam packed with BBQ, two steppin', and of course all things Drupal. 
Categories: Drupal

heykarthikwithu: Why DevOps is important? How this can be done in Drupal?

Fri, 2017-05-12 00:01
Why DevOps is important? How this can be done in Drupal?

Why DevOps is important?
How this can be done in Drupal?
This video will give you a brief idea about the 2 questions..!

heykarthikwithu Fri, 05/12/2017 - 12:31
Categories: Drupal

Aten Design Group: Fixing Invalid Translations for Drupal 8 Content Moderation

Thu, 2017-05-11 11:44

I recently migrated content from a Drupal 7 site to a new Drupal 8 install using core’s Migrate, Migrate Drupal and Migrate Drupal UI modules. A few months after the initial migration, I decided to enable core Content Moderation for use with one of my migrated content types. No beuno.

Just saving any content for which I had enabled Content Moderation resulted in this tasteless error:

The website encountered an unexpected error. Please try again later.

Clicking over to Recent log messages at /admin/reports/dblog revealed the following exception:

Invalid translation language (und) specified.

It was being thrown from two different places when I attempted to save a node.

The details for each in order were:

Drupal\Core\Entity\EntityStorageException: Invalid translation language (und) specified. in Drupal\Core\Entity\Sql\SqlContentEntityStorage->save() (line 770 of /Applications/MAMP/htdocs/project/core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorage.php). InvalidArgumentException: Invalid translation language (und) specified. in Drupal\Core\Entity\ContentEntityBase->addTranslation() (line 823 of /Applications/MAMP/htdocs/project/core/lib/Drupal/Core/Entity/ContentEntityBase.php).

Several quick searches didn’t turn up anything exactly applicable, but I did find a pretty useful summary of a similar issue that put me on the right track.

Basically, my content migrated from a Drupal 7 site was set with a legacy langcode of und. If I just load a node and output its language attribute using the Devel module’s dpm() function, you can see what’s amiss:

use Drupal\node\Entity\Node;   $node = Node::load(<My NID>); dpm($node->language()->getId()); // returns 'und', which was causing a problem

It’s the language specification of und that was preventing me from saving the content with Content Moderation enabled. Changing the language over to the site default, EN in my case, just took a minute with the following code.

use Drupal\node\Entity\Node;   $node = Node::load(<My NID>); $langcode = \Drupal::languageManager()->getDefaultLanguage()->getId(); $node->set('langcode', $langcode); $node->save(); dpm($node->language()->getId()); // now this returns 'en', which is good!

Now you can see that the language attribute is reflecting an appropriate value, which in my case meant I was able to save the node like normal with Content Moderation enabled. Fixed!

All that remained was doing the same operation for every node in the database. For my project there were only a couple of thousand nodes, so I just used the code below (I ran this at devel/php but you could do it in a module or wherever is easiest).

use Drupal\node\Entity\Node; $langcode = \Drupal::languageManager()->getDefaultLanguage()->getId();   $result = db_query("SELECT nid FROM node WHERE langcode = 'und' LIMIT 100"); foreach ($result as $record) { $node = Node::load($record->nid); $node->set('langcode', $langcode); $node->save(); }

I limited my query to 100 nodes to avoid a timeout, then just executed the code several times until all my nodes were updated. If you have tons of nodes that need updating, you might consider writing a hook_cron or using batch operations.

Warning: The site I was working on wasn't multilingual. The code above sets every node with a language specification of und to the site default, which may not be what you want for a multilingual site.

That’s it! It seems simpler in retrospect but took me awhile to understand what was going on. I also created an issue on Drupal.org so hopefully this bug will get addressed eventually.

Categories: Drupal

Acquia Developer Center Blog: Welcome to Cog: A New Drupal 8 Base Theme

Thu, 2017-05-11 08:05

Cog is a Drupal 8 base theme created and maintained by the Acquia Professional Service Front-end team.

Many great Drupal base themes already exist, so what does Cog bring to the table?

Tags: acquia drupal planet
Categories: Drupal

MD Systems blog: Improvements and changes in Commerce 2.x

Thu, 2017-05-11 07:51
The new version of Drupal Commerce has been rewritten from scratch, learning from what worked well and what was causing problems in Commerce 1.x. In this blog post, we will focus on explaining some of the key differences we have seen so far and how they affect developers and users.
Categories: Drupal

Agiledrop.com Blog: AGILEDROP: Agiledrop going to the nearest Drupal Camp

Wed, 2017-05-10 21:57
After a long travel to Baltimore, where two of our team members (Commercial and Operations director to be precise) attended DrupalCon Baltimore, we will have a much shorter distance to overcome this time. In fact, we'll be going to the nearest Drupal Camp possible. That's in Zagreb, where our development team will attend Drupal Heart Camp Zagreb. Since we are located in Ljubljana, Slovenia, our nearest destination would be our coast, where there was once a Drupal Camp Alpe-Adria. But since the Camp is not taking place there anymore – we discussed that with one of its organizers Janez Urevc… READ MORE
Categories: Drupal

FFW Agency: A Week of Learning & Growth at DrupalCon Baltimore

Wed, 2017-05-10 12:40
A Week of Learning & Growth at DrupalCon Baltimore leigh.anderson Wed, 05/10/2017 - 19:40

It’s hard to believe that another DrupalCon has come and gone — it feels like just yesterday when we were mourning the passing of Drupal 6 in New Orleans and unveiling our new branding in Los Angeles. DrupalCon Baltimore was a success for us, and we wanted to share some of our memories from the event.

Our Week at DrupalCon

It was an honor to introduce Dries on Tuesday morning at DrupalCon. We were grateful that we had the opportunity to discuss two projects that are near and dear to our hearts: The Open Y Drupal distribution, and Drupal Global Training Days.

We were also thrilled to have so many visitors drop by our booth. It was great seeing so many old friends and making new ones, and we’d like to say congratulations again to our raffle winners: Mark (pictured below) & Dennis, who won Apple Watches, and Patrick, who won an Amazon Echo.

FFW Session Recordings

We had a great time sharing our knowledge in trainings, sessions, and BOFs. If you didn’t catch the FFW crew in action, you can watch recordings of our sessions here:

  1. Anti-Crash Course: How to Avoid Drupal’s Most Common Pitfalls
  2. Using Drupal to Power the YMCA
  3. Scaling and Sharing: Building Custom Drupal Distributions for Federated Organizations
  4. Less Is More: What Modules, Features or API's Should We Cut From Core?
  5. Docksal: Better than VMs
Farewell, Baltimore; Hello, Vienna!

As always, we stayed for the community. We were heartened to see so many people working together to grow the project, navigate new territory, and have thoughtful conversations about the future of the Drupal software and the community’s governance. We’re looking forward to the continued discussions about the community’s structure and future; if you’d like to participate, you can find future meeting information here.

It was a pleasure to sponsor such a great event. We’re looking forward to seeing who we meet and what great conversations we have across the pond at DrupalCon Vienna this September.

DrupalCon group shot credit to Michael Cannon on Flickr.

Comments
Categories: Drupal

Valuebound: Getting Started With Drupal Commerce 2.x - Part 2

Wed, 2017-05-10 10:36

In the previous article, Getting Started With Drupal Commerce 2.x (Part - I) we have set up the Drupal commerce module 2.x and build the store. The next step to finish the basic commerce 2.x setup is to create Products.

Let’s have a detailed summary of e-commerce products creation in commerce 2.x.

1. Products :

Here we should note the main difference of Drupal Commerce 2.x (for Drupal 8) from Drupal Commerce 1.x (for Drupal 7). In Commerce 2.x, we now have such entities as Product and Product Variation. The product replaces product display of Commerce 1.x (node type, which has been linked to the…

Categories: Drupal

Powered By