Breitbandabbau: Telekom kündigt zehntausende VDSL-Anschlüsse in Niedersachsen

heise online Newsticker - 13. März 2018 - 11:30
Die Deutsche Telekom kann sich im Nordwesten mit dem Platzhirsch EWE nicht auf einen Mietvertrag für VDSL-Leitungen einigen. Zahlreiche Kunden sollen in dem Vectoring-Streit daher nun auf deutlich weniger Bandbreite herabgestuft werden.

United Internet will Bündnis für Hochgeschwindigkeits-Internet

heise online Newsticker - 13. März 2018 - 11:30
Ralph Dommermuth will mit einer Netzgesellschaft den flächendeckenden Gigabit-Internet-Ausbau bis 2025 realisieren und Glasfaser-Kabel bis in die Haushalte legen.

Falsche CO2-Angaben: 1,2 Mrd. Euro fehlende Steuereinnahmen

heise online Newsticker - 13. März 2018 - 11:00
Durch die Besteuerung von PKWs unter den falschen CO2-Angaben der Hersteller, verlor Deutschland allein im Jahr 2016 1,2 Milliarden Euro an Steuer-Einnahmen. Zwischen 2010 und 2016 beliefen sich die Ausfälle EU-weit auf ca. 46 Milliarden Euro.

EU-Kommission: Europa soll globales FinTech-Zentrum werden

heise online Newsticker - 13. März 2018 - 11:00
Mit einem Aktionsplan will die EU-Kommission den Einsatz von neuen Technologien wie Blockchain, Künstlicher Intelligenz und Cloud-Diensten im Finanzsektor beflügeln und einheitliche Regeln für Crowdfunding etablieren.

Apple meldet wasserdichte Notebook-Tastatur zum Patent an

heise online Newsticker - 13. März 2018 - 11:00
Wegen seiner flachen Notebook-Tastaturen hat Apple einige Kritik eingesteckt - etliche Nutzer beklagten verklemmte Tasten. Nun verrät ein Patentantrag, wie der Hersteller Tasten gegen Verschmutzung abdichten könnte.

KI-gesteuertes Marketing: Zalando streicht 250 Arbeitsplätze

heise online Newsticker - 13. März 2018 - 11:00
Zalando streicht 250 Stellen in der Marketingabteilung am Unternehmensstandort Berlin. Werbe-E-Mails sollen in Zukunft verstärkt von Algorithmen oder Künstlicher Intelligenz verschickt werden.

EU-Studie: Wachsende Kluft zwischen Männern und Frauen in IT-Berufen

heise online Newsticker - 13. März 2018 - 11:00
Der Anteil der männlichen Mitarbeiter im Digitalsektor ist laut einer Analyse im Auftrag der EU-Kommission dreimal so hoch wie der der weiblichen. Frauen seien als Startup-Gründerinnen zwar erfolgreicher, trotzdem sinke auch hier ihre Beteiligung.

Verbraucherzentrale Berlin: Telefonverträge häufigster Beschwerdegrund

heise online Newsticker - 13. März 2018 - 10:30
Telefonverträge sind die häufigste Ursache, mit der sich Berliner an die Verbraucherzentrale wenden. Schuld sind fehlerhafte Rechnungen und Probleme beim Anbieterwechsel. Internet-Shops versenden keine oder minderwertige Ware.

Innenministerium dementiert: Kein Cyberangriff auf Fluggastdaten-System

heise online Newsticker - 13. März 2018 - 10:30
Laut einem Medienbericht soll das Bundesverwaltungsamt nach einem Hack das Fluggastdatensystem abgeschaltet haben, das Bundesinnenministerium dementiert jedoch. Beim Auswärtigen Amt sollen Dokumente zum Brexit entwendet worden sein.

Smartphone bei Aldi: Lohnt sich das Moto E4 für 80 Euro?

heise online Newsticker - 13. März 2018 - 9:00
Ab dem 15. März gibt es bei Aldi Süd wieder ein Marken-Smartphone zum Schnäppchenpreis: Das Lenovo Moto E4 (Motorola E4) für 80 Euro. Ist der Preis gut und sollte man das nicht mehr ganz frische Smartphone kaufen?

Dorothee Bär: Facebook wird zum "Seniorennetzwerk"

heise online Newsticker - 13. März 2018 - 9:00
Die künftige Staatsministerin für Digitales will auf die Expertise von Jugendlichen setzen und denkt über einen Teenager-Thinktank nach. Soziale Medien wie Facebook hätten bei der jungen Generation inzwischen ausgespielt, findet Bär.

Appnovation Technologies: Drupal 8 Top Ten: Where Features Meet Functionality

Planet Drupal - 13. März 2018 - 9:00
Drupal 8 Top Ten: Where Features Meet Functionality Drupal 8 Top Ten: Where Features Meet Functionality Here at Appnovation, we live, love and breath all things Drupal, so it should come as no surprise that Drupal 8 is a big deal to us. With a cast list of over 3,000 contributors, Drupal 8 is a testament to the open source community, in which we have an active role, our dedication...

Wochenrückblick Replay: Wer hat an der Uhr gedreht?

heise online Newsticker - 13. März 2018 - 8:30
Warum gehen so viele Uhren falsch? Wer hat den Bundestag gehackt? Was taugen Samsungs Smartphone-Topmodelle? Nicht jede Frage dieser Woche ließ sich eindeutig beantworten.

C++-Workshop: Noch 10 Tage Frühbucherrabatt

heise online Newsticker - 13. März 2018 - 8:30
Die Spracherweiterungen und Bibliotheken für C++11 und C++14 stellt ein dreitägiges Seminar Anfang Mai in Hannover vor.

c't uplink 21.3: Gebraucht-Schnäppchen, Festplatten-Ausfälle vermeiden, Staubsauger-Roboter

heise online Newsticker - 13. März 2018 - 8:00
Heute in c't uplink: Tipps für den Gebrauchtkauf von Smartphones, Tablets & Co. Außerdem zeigen wir Euch, wie Ihr drohende SSD- und HDD-Ausfälle frühzeitig erkennt und welcher Roboter am besten staubsaugt.

Metal Toad: Programmatically Importing Drupal 8 Field Configurations

Planet Drupal - 13. März 2018 - 4:33
Programmatically Importing Drupal 8 Field Configurations Marcus Bernal Tue, 03/13/2018 - 02:33

Sometimes during development, a chicken and egg situation happens when business logic intersects with Drupal's mechanisms. For instance, a custom module, client_business_logic, is built to handle some unique, abstract bit of logic which depends on a taxonomy vocabulary that has fields added to it.

Dries Buytaert: How to use Drupal 8's off-canvas dialog in your modules

Planet Drupal - 13. März 2018 - 2:42

The goal of this tutorial is to show how to use Drupal 8.5's new off-canvas dialog in your own Drupal modules.

The term "off-canvas" refers to the ability for a dialog to slide in from the side of the page, in addition to resizing the page so that no part of it is obstructed by the dialog. You can see the off-canvas dialog in action in this animated GIF:

This new Drupal 8.5 feature allows us to improve the content authoring and site building experience by turning Drupal outside-in. We can use the off-canvas dialog to enable the content creator or site builder to seamlessly edit content or configuration in-place, and see any changes take effect immediately. There is no need to navigate to the administrative backend to make edits. As you'll see in this tutorial, it's easy to use the off-canvas dialog in your own Drupal modules.

I use a custom album module on https://dri.es for managing my photo albums and for embedding images in my posts. With Drupal 8.5, I can now take advantage of the new off-canvas dialog to edit the title, alt-attribute and captions of my photos. As you can see in the animated GIF above, every photo gets an "Edit"-link. Clicking the "Edit"-link opens up the off-canvas dialog. This allows me to edit a photo in context, without having to go to an another page to make changes.

So how did I do that?

Step 1: Create your form, the Drupal way

Every image on https://dri.es has its own unique path:

https://dri.es/album//

I can edit my images at:

https://dri.es/album///edit

For example, https://dri.es/album/niagara-on-the-lake-2017/niagara-falls-by-night-1 gives you the image of the Niagara Falls. If you have the right permissions you could edit the image at https://dri.es/album/niagara-on-the-lake-2017/niagara-falls-by-night-1/edit (you don't ????). Because you don't have the right permissions, I'll show you a screenshot of the edit form instead:

I created those paths (or routes), using Drupal's routing system, and I created the form using Drupal's regular Drupal form API. I'm not going to explain how to create a Drupal form in this post, but you can read more about this at the routing system documentation and the form API. Here is the code for creating the form:

<?php namespace Drupal\album; use Drupal\Core\Form\FormBase; use Drupal\Core\Form\FormStateInterface; use Drupal\album\Image; use Drupal\Core\Url; class ImageEditForm extends FormBase { public function getFormId() { return 'album_edit_image'; } public function buildForm(array $form, FormStateInterface $form_state, $dir = NULL, $img = NULL) { $image = Image::loadImage("$dir/$img"); $form['path'] = [ '#type' => 'hidden', '#value' => $image->getUrlPath(), // Unique ID of the image ]; $form['title'] = [ '#type' => 'textfield', '#title' => t('Title'), '#default_value' => $image->getTitle(), ]; $form['alt'] = [ '#type' => 'textfield', '#title' => t('Alt'), '#default_value' => $image->getAlt(), ]; $form['caption'] = [ '#type' => 'textarea', '#title' => t('Caption'), '#default_value' => $image->getCaption(), ]; $form['submit'] = [ '#type' => 'submit', '#value' => t('Save image'), ]; return $form; } public function submitForm(array &$form, FormStateInterface $form_state) { $values = $form_state->getValues(); $image = Image::loadImage($values['path']); if ($image) { $image->setTitle($values['title']); $image->setAlt($values['alt']); $image->setCaption($values['caption']); $image->save(); } $form_state->setRedirectUrl(Url::fromUserInput('/album/'. $image->getUrlPath())); } } ?> Step 2: Add an edit link to my images

First, I want to overlay an "Edit"-button over my image:

If you were to look at the HTML code, the image link uses the following tag:

Edit

Clicking the link doesn't open the off-canvas dialog yet. The class="edit-button" is used to style the button with CSS and to overlay it on top of the image.

Step 3: Opening the off-canvas dialog

Next, we have to tell Drupal to open the form in the off-canvas dialog when the "Edit"-link is clicked. To open the form in the off-canvas dialog, simply extend that tag to:

Edit

Some extra HTML in the tag is all it took; it took my regular Drupal form, showed it in the off-canvas dialog, and even styled it! As I wrote above, it is easy to use the off-canvas dialog in your own modules. Hopefully you'll be inspired to take advantage of this new functionality.

There are several things being added though, so let's break it down. First we add the a class called use-ajax.

  • use-ajax is the class that is necessary for any link including dialogs that use Drupal's Ajax API.

We also added some data-dialog-* attributes:

You can create a link like the example above using a Drupal render array; it will open a form page in the off-canvas dialog and redirect the submitted form back to the current page:

$elements['link'] = [ '#title' => 'Edit image', '#type' => 'link', '#url' => Url::fromRoute('album_image', ['album' => $album, 'image' => $image], ['query' => \Drupal::service('redirect.destination')->getAsArray()])->toString();, '#attributes' => [ 'class' => ['use-ajax'], 'data-dialog-type' => 'dialog', 'data-dialog-renderer' => 'off_canvas', 'data-dialog-options' => Json::encode(['width' => 400]), '#attached' => [ 'library' => [ 'core/drupal.dialog.ajax', ], ], ];

Because the dialog functionality might not be needed on every page, Drupal won't load it unless needed. We use the #attached element to tell Drupal that we want the JavaScript dialog system to be loaded for this page. It's a bit more work, but it keeps Drupal efficient.

Improving the developer experience

Applying the off-canvas dialog to my blog and writing this tutorial uncovered several opportunities to improve the developer experience. It seems unnecessary to set class' => ['use-ajax'] when data-dialog-type is set. Why do I need to specify both a data-dialog-type and a data-dialog-renderer? And why can't Drupal automatically attach core/drupal.dialog.ajax when data-dialog-type is set?

In discussing these challenges with Ted Bowman, one of the developers of the off-canvas dialog, he created an issue on Drupal.org to work on off-canvas developer experience improvements. Hopefully in a future version of Drupal, you will be able to create an off-canvas dialog link as simply as:

$link = Link::createFromRoute('Edit image', 'album_image', ['album' => $album, 'image' => $image])->openInOffCanvasDialog(); $elements['link'] = $link->toRenderable();

Special thanks to Ted Bowman and Samuel Mortenson for their feedback to this blog post.

MidCamp - Midwest Drupal Camp: ICYMI: Next year at O'MidCamp!

Planet Drupal - 12. März 2018 - 23:41
ICYMI: Next year at O'MidCamp! Next Year is O'MidCamp

Mark your calendars, next year MidCamp is St. Patrick's day weekend, March 14–17, 2019. Join us for the fun and add "saw the river dyed green" to "learned all the things".

MidCamp - Midwest Drupal Camp: MidCamp 2018 is a wrap

Planet Drupal - 12. März 2018 - 23:39
MidCamp 2018 is a wrap

MidCamp 2018 is in the books, and we couldn't have done it without all of you. Thanks to our trainers, trainees, volunteers, organizers, sprinters, venue hosts, sponsors, speakers, and of course, attendees for making this year's camp a success.

Videos are up

By the time you read this, we'll have 100% of the session's recordings from camp up on our YouTube Channel. Find all the sessions you missed, share your own session around, and spread the word. While you're there, check out our list of other camps who also have a huge video library to learn from.

Tell us what you thought

If you didn't fill it out during camp, please fill out our quick survey. We really value your feedback on any part of your camp experience, and our organizer team works hard to take as much of it as possible into account for next year.

Nextide Blog: Maestro D8 Concepts Part 4: Interactive Task Edit Options

Planet Drupal - 12. März 2018 - 21:34

This is part 4 of the Maestro for Drupal 8 blog series, defining and documenting the various aspects of the Maestro workflow engine.  Please see Part 1 for information on Maestro's Templates and Tasks, Part 2 for the Maestro's workflow engine internals and Part 3 for information on how Maestro handles logical loopback scenarios.