Upgrade Your Drupal Skills

We trained 1,000+ Drupal Developers over the last decade.

See Advanced Courses NAH, I know Enough
Jul 01 2020
Jul 01

We collected user feedback from which new functions were built, we also improved existing features and design. 4 highlights:

1. Social network posts

You can now use Lucius as a social network, instantly: let everybody place Posts to share what is happening and create interaction with inline comments and likes. 

Build community and culture out-of-the-box:

social network posts

Jun 26 2020
Jun 26
Jun 26, 2020 Drupal

For our Drupal distribution we needed to redirect all anonymous users to the login page, as for now it's implemented as a closed platform for social collaboration. The Drupal 8 way didn't work anymore; we fixed it for Drupal 9 and published a working module. 

So if you're building a Drupal social intranet, collaboration tool or community this might help you to direct them the right way -so they don't get an unfriendly 'access denied'.

Keep in mind that you still have to build the correct access control into all your pages with help of permissions / access checks / advanced route access, this module doesn't provide for that.

Clone and run off

We published the Drupal module here on Github so you can copy it and run off with it to do whatever you need. At the moment it's not a published Drupal.org project with all kinds of configurable stuff.

A short explanation of the code

First you'll have to implement an 'Event Subscriber' in the .services.yml file.

drupal event subscriber

More info: Subscribe to and dispatch events.

Next, it took a while before we figured it out, but this code in /src/EventSubscriber/AnonymousRedirectSubscriber.php is all it takes to make it work:

Drupal anonymous redirect subscriber

  1. More info on responding to events in Drupal here on Drupalize.me.
  2. Get current user with dependency injection.
  3. Get current request with ->getRequest(), here's what differs from the Drupal 8 version: we couldn't get ->getRouteName() to work properly.
  4. Check if current user is anonymous, but exclude some paths. Also, we had to facilitate user/reset/* with php's fnmatch, because that path contains a variable (the reset hash).
  5. Respond with the redirect to Drupal's login page.

Drupal 8 version

You can find the previous Drupal 8 code here, and we also found the Anonymous login module, but both didn't work in our Drupal 9 (then beta) install.

'quick-start' Drupal to test

To test this module fast in a fresh install, Drupal's quick-start might come in handy.

Need this as a contrib Drupal module?

Please let me know in comments down below, if there is enough positive feedback on this we might make it configurable and contrib it!

Jun 24 2020
Jun 24
Jun 24, 2020 Product

We collected user feedback from which new functions were built, we also improved existing features and did a design update. The highlights:

Activity badges in main menu

As soon as there is activity in a group, team or project, you will now see this with badges in the main menu on the left:

Activity badges

Text documents / Notebooks

It is now possible to create text documents, you can also use this as a notebook. Some examples:

  • (Project) documentation
  • Ideas
  • Manuals
  • General business information
  • Onboarding information, for new employees
  • Brainstorms
  • Event preparation.
  • ... and basically everything you want to share and manage in a text document.

The documents can be added in folders, in order to provide structure for multiple documents.

Add new text document:

Text doc

Format text document:

Text doc 2

  1. Title
  2. Content
  3. Add attachments
  4. Send e-mail notifications

Organize text documents in folders:

Text doc

Group types

The generic term 'group' turned out to be too abstract, we have now divided this into:

  • Company wide
  • Teams
  • Projects

group types

When you add new members, they are automatically placed in the 'company wide' groups and therefore have immediate access to general information such as company manual, onboarding information or house rules.

Stream items: chats vs other activity

A visual distinction has now been made between chat items and other activity:

Stream items

Design update

An upgrade has been made in the design: more modern color scheme, font and icons, which also improves readability and usability:

update design

Tuning existing features

For optimization, we worked on about ~30 minor issues on existing features.

Try it instantly 

Would you like to try Lucius right now? Click here to get started.

Install, host and customise it yourself, 100% open source

Please check this project page for detailed information.

Feedback, feature request

Please let us know your feedback or/and feature requests in the comments below, via our support form or via the open source issue queue.

Jun 12 2020
Jun 12
Jun 12, 2020 Drupal

While building this Drupal 9 site a few months ago we needed to handle the contact form. Normally we would use the Drupal Webform module, but that wasn't Drupal 9 ready enough at the time. So we decided to build the form ourself, AJAX based to make it as user friendly as possible and learn a few things. We published the complete code in a working, installable Drupal module. A small explanation:

So the Drupal example module contains:

  • The AJAX form;
  • A Block, so you can place it in some site region;
  • A Twig html file for block markup;
  • An implementation of hook_mail() to get the email sent.

Example end result

Te code is cloned from our support form, see the leading image above.

Copy and run off

We published it on Github so you can copy it and run off with it to do whatever you need, so at the moment it's not a published Drupal.org project with all kinds of configurable stuff.

Bootstrap based

The classes in the form are bootstrap's. So if you implement Bootstrap libs it will automatically look good / better.

Most important code to get AJAX working

drupal ajax form

  1. Add the AJAX callback and use '#type' = 'button', not '#type' = 'submit'.
  2. Add the libraries needed to get AJAX working.

drupal ajax form response

  1. Initiate AJAX response.
  2. Add AJAX commands, a full list of Drupal core AJAX callback commands.
  3. Return response.

Flood protection, honeypot and code optimisation

There is no flood protection added yet, and if you like to implement Honeypot then uncomment line 103 in AjaxContactForm.php

Of course code can be optimised, there is a too big procedural if/else and a Drupal Service might come in handy, also mail bodybuilding is not quite. But I think you'll git the pic by now.

Drupal 'quick-start'

PS, to test this module fast in a fresh Drupal install, Drupal's quick-start comes in very handy.

Find the code on Github

Download or view the code here on Github.

Like to see this as a contrib Drupal module?

Please let me know, if there is enough positive feedback on this we might make it configurable and contrib it!

Jun 09 2020
Jun 09
Jun 09, 2020 Product

Based on user feedback and own experience, we built new features and tuned existing ones. Here are the updates:

1. Choose your own section names

You can now choose a custom name for each section, you can even provide different names in different groups. Go to the group settings and choose your custom section names:

group-settings-custom-section-names

See your own section names:

custom-section-names

2. Upload header image per group

You can now upload a header image in the group settings:

upload header

group header

3. Block and unblock users

User managers were already able to block users, but there wasn't a 'blocked users' list yet. That is now available including 'reactivate' function:

block user

reactive user

4. Archive groups

It's now possible to archive groups and of course also de-archive them:

archive group

You can find the archived groups via the drop down behind 'Groups' in the left sidebar:

groups archive

Unarchive a group If you click on the title of an archived group, you can access it just like an active group and uncheck 'Archive this group' in Group settings.

5. Linked stream items

All items in the activity stream are now linked to the corresponding content details page In example underneath, a message, files and icebreakers:

Stream linked items

Misc tuning

  • Homepage can't be set to a disabled section anymore.
  • Facilitated a default user image.
  • You can't block yourself anymore.
  • You can't remove a role from yourself anymore.
  • Fix for calculating height in stream / chat holder.
  • Stream wrapper auto-sizing fix for optional header.
  • Prevent 'notice' when mailing 0 users.

Try it instantly 

Would you like to try Lucius right now? Click here to get started.

Install, host and customise it yourself, 100% open source

Please check this project page for detailed information.

Feedback, feature request

Please let us know your feedback or/and feature requests in the comments below, via our support form or via the open source issue queue.

Jun 03 2020
Jun 03
Jun 03, 2020 Drupal

In 2014 we were proud to release OpenLucius 1.0 on Drupal 7. Since that time a lot has happened in the (Drupal) world as well as with our agency.

We had to drop support in 2018 unfortunately, but we always had the intention to build a new version; that would encapsulate all learnings from the past. Early 2020 we were finally able to start developing the new version in Drupal 8; first release is now available in Drupal 9.

What is OpenLucius

OpenLucius aims to be a lean and fast social, culture building, productivity platform; ready to use after installation. The goal is to be easy-to-use software that helps your people to:

  • Communicate better;
  • Manage knowledge;
  • Build culture;
  • Get projects done;
  • Easily sharing and managing (large) files and folders;
  • ..and much more to come.

Goal is also to facilitate an optimal developer -and site builder experience for building add-on modules and easy management / updates.

Out-of-the box functionality

Currently (May 2020) these core functions are working directly after installation of the OpenLucius Drupal distribution:

End-user guide

For all end-user functions check out the product pages.

Try it instantly

If you'd like to try it this instant, please visit the product website and hit the 'Try now' button.

Updates and maintenance for Drupal developers and site builders: OpenLucius 1 (D7) vs OpenLucius 2 (D9)

Install profiles did have quite a bad reputation as it comes to maintaining it. Indeed, it was relatively hard back in the days. But maintaining an install profile in Drupal 9 is much more easy than in Drupal 7, which is one of the main reasons we were exited to build OpenLucius 2.0:

  • Major Drupal upgrades (D8->D9, D9->D10, etc) are not complex migration projects anymore, if coding done right. Since Drupal 8 most important thing is to rewrite deprecated code, read more on preparing for Drupal 9. With help of a good IDE and tools on linked page, it's relatively easy.
  • OpenLucius 2 has no module dependencies, other than core. The Drupal 7 version depended heavily on contrib modules, which made it hard to maintain and impossible to upgrade without that complex migration project.
  • It's fully Composer based. In comparison with the Drupal 7 way of maintaining distributions, Composer based management is a great relief.
  • No more Drupal 7 Features, but Drupal 9 core configuration management. Also self explanatory I guess.

Core customisation and contrib integration

  • Just like Drupal core, we put as much code as healthy possible into Services, so developers can override those, which makes OpenLucius core customisation relatively easy.
  • We'll build API functions / hooks where needed, so contrib / 3rd party modules can integrate. Right now we already have a few hooks in place; more on this in upcoming articles.

Installation

You can install and manage the code with Composer:

composer create-project lucius-digital/openlucius-project:2.0.0-alpha1 MY_PROJECT_FOLDER

Code hosting

Currently (May 2020) the code is hosted on Github here and here. When possible we'd like to host it on Drupal.org, but right now we get compatibility issues via Composer when the install profile is hosted on d.o. When Drupal 9 stable is released we will probably host it on d.o.

Install manual

Please check out the complete install guide for:

  • Installing the OpenLucius distribution in 3 easy steps;
  • (optional) Using the Docker environment;
  • (optional) Using Drupal core's 'quick-start';
  • (optional) Installing the Node.js / Socket.io package.

Project content

The project package facilitates:

  • The OpenLucius installation profile;
  • Optionally, a ready-made Docker environment;
  • Optionally, a Node.js / Socket.io package for real-time goodies like the chat.

Project page on Drupal.org

The project information above is also written on the OpenLucius project page on Drupal.org.

Let's talk

So, we're very exited about this release and would love to hear your feedback, please let us know your developer-, support- or feature requests in the OpenLucius issue tracker on Drupal.org, or leave a comment below. We're looking forward to next releases and keep bringing the good stuff!

May 17 2020
May 17
May 17, 2020 Drupal

I would like to stay up to date on all available open source / 'contrib' Drupal modules. 'There is a module for that', this applies to many use cases within Drupal; a deadly sin to build something that already exists, or is partially available. We keep track of the latest module releases every month, including what we noticed about module updates in the past month:

1. Clientside Validation

The Form API from Drupal is very comprehensive: neatly building, formatting and developing forms, in the broadest sense of the word, are interwoven into the system. There is no clientside validation as standard, simply put: that as soon as a visitor enters a 'form element' (for example his first name), that field is immediately validated. And not just after clicking on the 'Save' button.

https://www.drupal.org/project/clientside_validation

2. Forms Steps

Giving enough attention to forms on your website is essential; these are often a conversion point and you want nothing to stand in the way. A multi-step form can increase your conversion rate by 300%. With this module you can easily create such a form in Drupal.

https://www.drupal.org/project/forms_steps

3. Better Search Block

You can make the standard Drupal search box beautiful by overriding using Twig templates. But if you want a less technical approach, this module could help: it offers some configuration options such as:

  • Making some layout elements adjustable
  • Making the placeholder text adjustable
  • Mini animations as soon as a visitor clicks in the box.

https://www.drupal.org/project/better_search

4. Multiple Registration

A powerful permissions and roles system is embedded in the Drupal core, but offers only one registration page for website visitors as standard. If you want different registration pages on your website, for different roles (for example, customers and suppliers), give this module a try.

https://www.drupal.org/project/multiple_registration

5. Simple XML sitemap

An XML sitemap is essential for your website SEO. There are several Drupal modules that generate this XML sitemap for you, but this one seems to be the most popular with nearly 45,000 installs. This also supports the latest Google standards, regarding multilingual content.
Googlebots will thank you later.

https://www.drupal.org/project/simple_sitemap

6. Advanced Text Formatter

Within the Drupal core you can set according to which View mode an entered text field can be shown to the website visitor, for example 'default', 'teaser' or 'trimmed'. If you want more control over the way in which the entered text is displayed, install this module so that you can configure by field:

  • Automatically cut text on a certain number of characters.
  • Adding an ellipsis (...) as soon as a sentence is truncated.
  • Always cancel on whole word.
  • Tokens for adding automatically dynamic information.
  • Allow certain html tags.
  • Apply specific Text Format.

https://www.drupal.org/project/advanced_text_formatter

7. Menu Item Extras

Do you want to add extra fields to menu items? Install this popular module. You can see it as 'Fieldable menus', so you can store and display all kinds of extra information with a menu item.

https://www.drupal.org/project/menu_item_extras

8. Visitors

Don't want to give away all your data to Google? Or do you run Drupal as a social intranet with private data? Then you can install this module to generate statistics. It gives reports about the visitors to your website, in diagrams and other textual statistics. Some of the available reports:

  • Pages that have recently been visited
  • Pages that are often visited
  • Page visitors per month / week / day
  • Total number of visitors
  • Number of unique visitors
  • Number of registered users
  • Visitors by country, city
  • Number of visits per page per city

For the complete list, check the module page:

https://www.drupal.org/project/visitors

9. Geofield Map

Easily create beautiful maps using this Drupal module, it is built on the popular Geofield module and works in both the frontend and the backend with interactive maps makes management easy for content managers. The 2.x version even supports custom markers and images, based on dynamic data from that folder. Watch a live demo here.

https://www.drupal.org/project/geofield_map

10. Views Bulk Operations (VBO)

https://www.drupal.org/project/views_bulk_operations

This module has been around for a long time, but recently received another update. Using Views you can configure Drupal content lists in the broadest sense of the word: you can make a list of basically everything that lives in Drupal with it - from simple blog overviews to complex search pages with facets integrated in Solr.

This module expands Views with the possibility of having an action on all items in such a list: a 'bulk operation' as an extension of this limited function of the Drupal core.

An example is bulk editing of a selection of nodes. Exporting data to excel or csv is also possible via this additional module.

11. Monolog

Drupal core has a good log, in which you can find notifications, warnings and errors. But sometimes you need more reporting: this module offers integration of the Monolog library- "Logging for PHP". It integrates with Drupal Watchdog: the core log, so the module works with the Drupal core and contrib / open source modules.

https://www.drupal.org/project/monolog

12. Field Defaults

You can configure your content model in Drupal using content types and fields. After / during this configuration you build your website, after which you will fill it with content. Sometimes the content manager discovers after a while that an extra field is needed (for example an 'Intro Text'). You can easily add that field in Drupal, but with all existing content items that field is empty. This module comes in handy: as soon as you create a new field, it can automatically supplement all existing content with a chosen default value for that field.

https://www.drupal.org/project/field_defaults

13. Allow site iframing

For security reasons a website may not load within an i-frame, the Drupal core prohibits that by default. If you want to bypass this intentionally, this mini module offers the solution.

https://www.drupal.org/project/allow_iframed_site

14. Upgrade Status

A module mentioned in the Drupal Keynote by leader Dries Buytaert in the past DrupalCon. Specific for Drupal 8 installations: this module scans all code and reports whether it contains 'deprecated code'. Simply put, that is code that no longer works in Drupal 9. To make it easy to upgrade to Drupal 9 at a later stage, it is important not to have a deprecated code anymore, this module provides a good insight into that. Also: if you use the correct IDE, it will immediately indicate inline with the code.

View this directly in the Driesnote

https://www.drupal.org/project/upgrade_status

15. Views Bulk Edit

An addition to the Views Bulk Operations module: provides bulk updating of 'entity values': for example, filled-in text fields in content item, or categorization using Taxonomy

https://www.drupal.org/project/views_bulk_edit

16. Mobile Device Detection

Nowadays the responsive layout of your website is determined in the frontend: the html / css / js determines what it will look like on a certain screen format and also determines whether certain blocks are visible or not.

If you want to catch this on the basis of the website visitor's device, then take a look at this module. Depending on the device, you may or may not have certain Drupal blocks displayed to the website visitor, based on the device.

https://www.drupal.org/project/mobile_device_detection

17. Quick Link

Traced as a result of this blog: this module offers an implementation of the Quicklink library from Google Chrome Lab for Drupal. Quicklink is a lightweight JavaScript library (compressed less than 1 kb) that enables faster consecutive page loads by following in-viewport links.

How Quicklink works
Quicklink makes attempts to speed up navigation to subsequent pages. It:

  • Detects links within the viewport (using Intersection Observer)
  • Wait until the browser is inactive (with requestIdleCallback)
  • Checks whether the user has a slow connection.
  • Prefix of URLs to the links (using
    or XHR).

Under construction
The module has just been released and is currently under heavy construction, but absolutely one to watch.

https://www.drupal.org/project/quicklink

18. Freelinking

A 'looser' way for content managers to create links. By default you must enter a 'hard' link to a page, but after installing this Drupal module you can also use, for example, the page title, in which case you enter: [[nodetitle: Title of the Page]].

This module automatically turns this into a working link.

https://www.drupal.org/project/freelinking

19. Hook Event Dispatcher

There are several articles about why you have Drupal events or Drupal hooks They are both in Drupal 8, hooks are from the legacy era (Drupal 7 and earlier) and events originate from the Symfony framework which Drupal 8 is built on. The creator of this module believes that the hook system is outdated, but that is an ongoing discussion.

Anyway, this module ensures that Drupal dispatches some hooks as events, so that those hooks can be implemented as events. Because that way of implementation would be better. Among other things, it is about:

  • Entity hooks
  • Form hooks
  • Preprocess hooks

https://www.drupal.org/project/hook_event_dispatcher

20. Modules weight

Drupal executes code in modules on order of weights of modules. The module with the highest or lowest weight is executed first. As a result, it is possible that a certain code can overwrite each other because they have the same type of application. It is not possible to set which code has priority, so with the help of setting the module weight.

In the 'early Drupal 7 days' we did this by hand: directly adjust the values of the weights in the database, now there is a module for which you can simply configure this, nice:

https://www.drupal.org/project/modules_weight

Wrap up

That's it, for this month then. Hopefully you are well informed about the latest module releases and you will care a lot because 'there is a module for that'. For another xx cool Drupal modules - stay tuned next month!

May 14 2020
May 14
May 14, 2020 Drupal

Generically speaking, there are two kinds of files, when you manage a website- or app: public or private. Technically speaking you will have to decide how your content management system will manage those files and how to apply the correct security on them. This depends on the kind of services you are providing with your website- or app.

Public files

These are primarily used by websites with public content, with nobody logging in (except for content managers and admins) and which are mainly used to provide information regarding products and/ or services.

Private files

These are primarily used in case of a web application such as:

  • Social intranet;
  • Online community;
  • Chat application.

For the last one you’d like all files being uploaded by a user not to be visible for just everybody – and you’ll have to design your system accordingly.

Private and public files in Drupal

Drupal contains an extensive file management system which can facilitate public and private files. You can reach the settings via the configuration screen:

As soon as you click on the File system the details will appear:

  1. Directory where the public files are being saved.
  2. The absolute URL which is put in front of all public files
  3. Directory where the private files are being saved, in this case not activated yet.
  4. Standard way how a file can be downloaded, as soon as the private files directory has been set up, you’re also able to opt for private.
  5. Time before temporary/ orphaned files will be removed permanently. This concerns all files with status 0 in the database.

Activate Private files in Drupal.

The above is a standard installation, with the files set on public. But as described, you might want to protect your files, making them accessible to users with the right permission only – instead of the whole, anonymous world. This is how to do it:

Configure the private files directory in settings.php:

In this case you opt for ../files. Makes sure this directory is outside the webroot, otherwise there might be a chance that your private files are publicly available anyway. If you empty your caches after that (Flush all caches) you can pick you pick private files as default download method:

  1. The path as set in settings.php
  2. Adjust the /tmp directory, ensuring temporary files to also be protected.
  3. Set private files as default download method.

Now, Drupal is configured to treat all files as private: if visitors want to download a file, or want to look at an image for example, it will be via a Drupal system call and not by directly invoking the file by the browser. In that call Drupal decides whether the visitor concerned has permission to download the file.

Determining yourself whether someone is allowed to download a private file or not with the help of hook_file_download().

Currently, we are building a the chat for Lucius based on Drupal and NodeJS. This has group chats, in which files can be shared. Of course we only want people in the group concerned to be able to download the files from that group. For example, if you’re not in group A, it ought to be impossible to approach files in that group A.

File management

For more information, see the files manual.

This concerns a custom web-app, that’s why Drupal doesn’t have suitable permissions to sufficiently secure this. but no worries: hook_file_download() to the rescue, here is a code which we produced in our .module file:

Drupal recognizes the hook_file_download(),making sure it will invoke this function when someone is about to download a file via Drupal’s private file system.

What this code basically does:

  1. Checking who the current user is.
  2. Checking whether that user is in the channel to which the file has been uploaded.
  3. When the user is in the channel: loading file and returning file, making it available for the visitor concerned.
  4. When the user is not in the channel concerned: provides a not found.

Wrap up

Generically speaking, there are public and private files on the internet. Determine which file system you need, before you start producing an online platform, website or app. If you deploy Drupal, I hope that you can structure the files properly and securely with the information as provided above. Any questions? Let me know!

Image Credits

May 03 2017
May 03

Joris Snoek - Business Dev

+31 (0)20 - 261 14 99

Within a Drupal 8 website, there are usually a number of texts that the content manager must be able to manage but that are not real content items.

Dutch version of this blog here.

We resolve this by making a user-friendly configuration form in the backend of Drupal 8, accessible to content managers. This allows us to make sure that all non-content is easy to manage, so that content managers do not have to dig through all kinds of screens in a technical backend to find the correct settings.

An example are the texts (and background image) in this Frontpage header block:

An example of the corresponding Drupal 8 backend configuration form:

This blog series consists of three parts:

  1. Building the Drupal 8 backend configuration form and defining a Twig template file.
  2. Development of a custom Drupal 8 Block, in which imported texts are retrieved from the configuration form; rendered in a custom Twig template file.
  3. Managing the background image via the already defined backend configuration form.

In this part 1:

  1. Create a new module using Drupal Console.
  2. Implement Drupal 8 backend configuration form.
  3. Defining Twig template file - and variables, for facilitating dynamic html in the frontend.

1. New module with help from Drupal Console

Drupal Console is a CLI tool for boilerplate code to generate (also called skeleton code). Console also offers functions to perform and debug actions within Drupal 8.

Drupal Console also offers functions to generate Drupal forms, that is, boilerplate code. To do this, we have to start creating a new module in which the form is then implemented.

Generate a new module using Drupal Console:

  1. Enter command drupal generate:module in a terminal.
  2. Enter a name for the new module. We are only going to use this module for configuration purposes, so I call it 'OpenLucius Configuration'.
  3. The yellow text is the default entered by Console if you press enter without entering anything. This default module machine name is fine, so press enter.
  4. The same goes for the module path. It is a best practice in Drupal to subdivide the /modules folder into /contrib *, */custom and /devel.
  5. Enter a description, it appears in the Drupal 8 backend on the global /config screen.
  6. Yes, I want to generate a .module file. We need this later to implement a hook_theme, where we create a Twig template file known to Drupal. In that, the dynamic html will go live.
  7. We indeed need a themeable template file as mentioned in (6). By default, this will not generate the correct naming, but it is useful as an example code.

2. Generate Drupal 8 backend configuration form

The following fields must be managed by content managers:

  1. Frontpage header title
  2. Frontpage header subtitle
  3. Frontpage header intro text
  4. Frontpage header read more link
  5. Frontpage header background image

Now, for example, Site name and Slogan fields are already available in Drupal 8 core and may be used as Frontpage header title and Frontpage header subtitle.

But for the convenience of content managers, we do not use those Drupal core fields and we create one easy-to-use form that controls all non-content fields. Thus, no fragmentation of features across all kinds of technical administrators, which scares a content manager.

Defining fields and field names, we always do it in English, given that the Drupal 8 backend is always English and it is the language of development (code, comments, etc) as well. We always keep the backend English for consistency in, among other things, debugging and helpdesk issues from customers.

Generate the fields

We start creating the text fields, the image field we deal with in part 3 of this blog series.

I generate the required backend form in the newly created module as described above. We make the form and the text fields using the Drupal Console:

  1. From the web root of your Drupal 8 installation: enter drupal generate:form:config in a terminal.
  2. Specify which module you want to put in the form, so you must generate it in an existing module; Therefore we first created the Drupal 8 module above.
  3. Do you want to load services? Read more about Services and dependency injection in Drupal 8. For this example it is not necessary to key enter.
  4. Start building up the form fields by defining the first field, in this example I start generating the textfield 'Frontpage Header Title'.
  5. Give your field a Label, this text will be above the field. Enter a clear name here, so Drupal content managers know what to enter here.
  6. Configure optional values for elements associated with this field.
  7. You can enter as many fields as you like, until you reach “New field type (press to stop adding fields) [ ]:” thus pressing enter without entering text. Then some final questions will be asked, after which the form will be generated in the indicated module:

  1. Once you have entered all the elements, leave it blank and hit enter.
  2. Enter the desired path (route), this default is fine. More about Drupal 8's routing system here
  3. The default Yes is fine, we would like it to appear in the backend menu so that content managers can easily navigate to it.
  4. Enter the title of this desired menu item and place it in this default parent menu: This will appear in the Drupal Backend menu.
  5. Give it a description, which appears on the config overview page:

Drupal 8 Form API

Drupal 8 has an extensive Form API, which lets you see which elements and options are available. For more information see:

The folder and file structure of the generated module looks like this:

The generated code for the form:

Install module and Drupal 8 backend form

Install the module so that the generated form becomes active. This can be done with Drupal Console's command module:install :

A link is created in the configuration screen:

And the form detail page works:

The form is used directly, saving the values in the database is immediately:

3. Defining Twig template file and template variables, for facilitating dynamic html in frontend.

Drupal Console has just created a template file and defined it as hook_theme(), so that Drupal 8 recognizes this and we can call it in modules through the Render API and / or those in Drupal 8 theme can override.

But as Drupal Console has defined it, it's too generic, I'd like it more specific because more Twig template files will be added soon. Also, I want to add Twig template variables, to make the html dynamic. These variables will facilitate the input of content managers, making it completely dynamic through the backend form.

To initiate this, I make two adjustments:

  1. I change the template file name so it's less generic and we can already deduce what the name is being used for.
  2. I change the Twig template definition in hook_theme(), so Drupal is aware of the 'new' Twig template file. Also, I have defined template variables so that Drupal knows which variables are available. These Twig variables I will further implement and explain in the next part of this blog.

Twig and Drupal 8

Learn more about Twig templating in Drupal 8? Click Here.

Placing HTML in Twig template file

As the last action in this part of this blog series, I place the (already developed) HTML in the Twig template file:

As you can see, I immediately placed the Twig variables, which in the following section we will go to "fill in" with texts entered by the content manager in the backend form.

Wrap up part 1

Alrighty, we have now created a module and generated a Drupal 8 backend form. In addition, we have defined a Twig template file and variables, which means that Drupal 8 knows that our template file exists and which variables are used in it.

But we do not see this HTML anywhere in the front end, and the texts are not yet dynamically loaded from the configuration form.

How do we do that? That's what I describe in Part 2, so stay tuned!

Apr 12 2017
Apr 12

Joris Snoek - Business Dev

+31 (0)20 - 261 14 99

It took a while before I could write a new edition, I was just busy with the production of customer social intranet projects :) Here again with a brand new version, what struck me in module updates in the past month:

Dutch version of this blog here

1. D8 Editor Advanced link

A popular module that extends the standard editor in Drupal 8 with additional options for managing links. You can now add the following attributes:

  • title
  • class
  • id
  • target
  • rel

https://www.drupal.org/project/editor_advanced_link

2. Password strength

Default password checks are stupid and annoying for the user: they can check the entered password meets certain rules, such as the number of characters and varying types herein (symbols, numbers, capital letters etc.).

This is a stupid way of checking because the password 'Welcome123' is accepted, while it is easy to guess.

This module enables a secure password policy by "pattern-matching" and "entropy calculation”. Almost every type of password is accepted, as long as it has sufficient entropy.


Source

How it works

Instead of checking strict rules, this module calculates the expected time a brute force attack needs to retrieve the password. This is calculated based on underlying patterns:

  • Words that appear in a standard dictionary, common first and surnames and other default passwords.
  • Words from a dictionary, but written in Leet / 1337. For example, where the "e" is written as a three and “a” like an @.
  • A standard sequence of letters like "abcdef", "qwerty" or "123456"
  • Dates or years.

This module has been around since 2007, I wonder why I only encounter this now :) It is currently available in alpha for Drupal 8 and stable for Drupal 7 available - it is supported by Acquia and Card.

So if you want people to not have to bother to look for a password such as "one special character, 1 upper case and at least 8 characters', then this module offers a solution.

https://www.drupal.org/project/password_strength

3. Better Field Descriptions

In order to give content managers issues, it is possible to write an explanation of all content fields that they import. But the standard explanation in a field in the backend of Drupal are often irrelevant, to not apply these generic texts in the implemented user story of the installation concerned.

After installing this module you can:

  • Content managers have their own explanation text per field.
  • Set where it stands: above or below the field.
  • The explanatory style that you like.

https://www.drupal.org/project/better_field_descriptions

4. Better login

Want to make the standard Drupal login screen better? Then install this module and you are good to go: through template overrides you can then do the required further tuning of the layout of the login screen.

https://www.drupal.org/project/betterlogin

5. Ridiculously Responsive Social Sharing Buttons

Another social sharing module, but as you see in the title: these are terribly responsive. The icons are SVG based and you need no external services such as AddThis.

Advantage: you're less dependent and have your data in hand, downside: you have less functionality- such as comprehensive statistics.

https://www.drupal.org/project/rrssb

6. Flush Cache

If you are not using Drush or Drupal console then you can Drupal caches flush via “the 'Flush all caches" button in the Drupal backend. But in a production environment, you will almost never flush all caches, it can cause severe performance problems.

This module solves that problem: install it and you have more control over the caches you want to flush.

https://www.drupal.org/project/cacheflush

7. Multiple Selects

Have your Drupal content management easier with 'multiple selects' administration, this image seems to me to speak for itself:

https://www.drupal.org/project/multiple_selects

8. Neutral paths

If you are running a multilingual Drupal website, visitors can see the content in one language: the currently active language. Sometimes you would like to see pages in another language. In addition: content managers / Drupal administrators usually want English and not the backend default language, in our case, often Dutch.

Issue tracking for example, much easier if the backend is in English: Drupal documentation and support in English is much more available than in Dutch.

This module ensures that you can visit other pages in another language than the default. And can navigate the backend in English, while frontend is in another language.

https://www.drupal.org/project/neutral_paths

9. Password Reset Landing Page (PRLR)

Drupal core includes a 'password' function: If you have forgotten your password then you can request a one-time login link that is automatically mailed to you.

If you click on the login link, you will see a screen with a login button. Once you click the 'login' button you are logged in and you are redirected to your profile page - that's it.

You are in this situation where your password is lost / forgotten. You are not required to change your password. This is not usually done, so people often endlessly request login links.

This module solves this: the screen where you end up after clicking on the login link not only contains a login button, but also a function to change your password immediately.

https://www.drupal.org/project/prlp

10. Auto Purge Users

The user list in Drupal is usually not or hardly ever administered. If people have long been inactive or have not completed their registration, the account can usually be removed to avoid overhead and security issues.

This module does it for you automatically, it checks inactivity below a point and blocks users if they meet:

  • Certain time inactive.
  • Account never activated after registration.
  • Not been logged in for a period of time.

Not a popular module, but in the case of an example Drupal social intranet it can come in handy.

https://www.drupal.org/project/purge_users

11. Vertical Tabs Config

Want to influence the order of the Drupal tabs? Or do you want some tabs to not show all of your content manager? To keep tabs simple and usable you can install this module: select which tabs to show and in what order.

Modules with similar functions: Simplify and Hide vertical tabs.

https://www.drupal.org/project/vertical_tabs_config

12. Custom Search

The default Drupal search is fine, but really standard: you have few options to tune the engine. After installing this module, changes that you can then include are:

  • Change the default label in the search box.
  • Set a default text in the search box.
  • Tune 'Advanced Search'.
  • Change the text on the "submit button”.

And much more, see module page:

https://www.drupal.org/project/custom_search

13. Persistent Login

Drupal 8 core does not have a 'remember password' function when you log in. You can remain automatically logged for some time, but that is based on a PHP session. This module does not, you can also:

  • How long users can stay logged in.
  • How many places a person can be logged in at once.
  • Select certain pages that the user must log in again at. These are usually pages where more sensitive information is available.
  • Allow the user to delete all his logins themself.

https://www.drupal.org/project/persistent_login

14. Realistic Dummy Content

Source image: gov.uk

Using the Devel module you can automatically generate content so you can see if your modules / themes work well. But it gives an unrealistic picture of the end result, this module generates more realistic images and texts.

https://www.drupal.org/project/realistic_dummy_content

15. Password Policy

Although I am a fan of the aforementioned 'Password strength' module, this can also be useful if you want to make a specific password policy on your Drupal website.

https://www.drupal.org/project/password_policy

16. Mass Password Reset

This module, we often use to implement Drupal social intranet OpenLucius: in preparation of a new intranet you can add all users and content on a test environment, without notifying people of their new accounts through e-mail.

Once the social intranet went live, we sent all users at once an email with a login link via this module; the system was live!

https://www.drupal.org/project/mass_pwreset

Wrap Up

So far that’s what I noticed last month in Drupal modules, stay tuned for more fat Drupal content!

Source header image

Mar 08 2017
Mar 08

Previously we published 17 tips and trick for OpenLucius users which was well received by OpenLucius users, this sequel was inevitable.

The use of standard features in OpenLucius is usually readily apparent, for example: adding groups, members, tasks, messages, files, folders and book pages.

There are many useful functions in OpenLucius that make working in it more fun and easy, but are a little less obvious:

1. Turn off direct messages for clients

For one-to-one messages between two people Direct Messages are possible. Here people can exchange short messages in a chat-like way:

For some users this feature would only work for internal staff; they do not enable this feature for example, for the clients they work with on projects in OpenLucius.

To turn off Direct messages for customers: Go to Settings -> Notification Settings and uncheck Add direct messages to customers.

2. Default enabled apps and app-order when creating a group

Each organization uses OpenLucius in its own unique way, such as:

  • Social intranet
  • Project management system
  • Helpdesk for clients
  • Documentation system (wiki)
  • File manager

Consequently, it is useful that once someone has created a new Group it immediately turns on the desired default apps, in optimal order. This is under Settings -> Application Configuration:

3. Email to external people

There will be plenty of communication with external people who do not participate in your OpenLucius social intranet. But you do want to document the communication with these people and make it easy to find for everyone in your teams. Consider:

  • Collaborating to offer: potential customer is not yet added in OpenLucius.
  • Collaborating with a supplier.
  • Stubborn customers who stick to email and cc-trees.

Constantly copying and pasting the external emails, you become fed up quite quickly. Therefore, in OpenLucius you can easily email external people all communication - via a message, task, event, document, book page or comment:

Subsequently, which external emails are sent is neatly logged:

FYI: if you enable the email integration email replies can automatically be places as a comment in OpenLucius.

5. Block Users

Do you want people to not be able to login because they are out of service, or a project is over? Then you can simply block them, their created content will continue to exist.

From the user dashboard, edit the user:

Choose blocked and save:

6. Your own tasks board

Work focused on your tasks via a personal tasks board: this board collects all your tasks from all groups you are a member of. It is also possible to directly filter a group in this personal Kanban board:

7. Empty directory = another icon

OpenLucius includes an app for easy file management within your teams which includes all kinds of useful features, such as directly showing that a folder is empty:

8. See the context of a file

A file is always has context: for example, it belongs to a message, a task, a document, a comment, an email, etc. It is convenient to immediately see the context of a file.

Within OpenLucius you can add files anywhere: in messages, tasks, events, book pages and comments. Then all these files are listed in the Files app. You can see where a particular file was uploaded:

9. Archive a task lists

Within groups, you can create task lists, in which you can group tasks and prioritize. Such a task list can be archived, so you keep your current job screen relevant:

That's all folks

That's all for now: 9 tips and tricks to make your daily work life easier. I guess more tips and tricks later on, so stay tuned!

Dec 29 2016
Dec 29

The use of basic functions in OpenLucius are pretty clear most of the time. Think of basics like: adding groups, members, tasks, messages, files, folders and book pages.

But there are many useful functions in Drupal distro OpenLucius that make working in it more fun and easy, but those functions are a little less obvious for end-users.

17 tips and tricks to work faster, smarter and more efficient:

Groups

1. Choose which apps are enabled by group:

2. Determine the order of the apps in a group:

You can determine the order of the enabled apps in a group, the foremost positioned app will automatically be default: it opens when you click on the group. By default this is 'Overview', but you can open 'Messages' as first by dragging it to the front for example.

3. Archive a group:

If you click on "Archive" under the drop-down button behind the group name (1), the group will be placed in the archive (2). A group can be reactivated at any time.

Taskboard

4. Easily prioritize tasks:

Through dragging them in the task board:

5. Manage the status of an assignment yourself:

  1. Click on Username -> 'Configuration'
  2. Hit tab 'Task statusses'
  3. Add new Terms
  4. Order Terms by drag and drop

6. "Open in new tab" shows the task in a full screen window, not in a pop-up:

Task list

7.Direct, adding assignments inline:

8. Press 't' to add a task directly:

From any screen OpenLucius you can type 't' on the keyboard: the "Add Task" window appears, in which you can directly enter a job in any group. If you are already in a group, that group will be automatically selected:

Calendar

9. Show OpenLucius calendar in your own calendar:

This is possible in Outlook, Apple Calendar or Google Calendar; all the more common calendars support. Click on the orange icon at the bottom left of the calendar (the iCal feed):

10. Drag assignments on your personal and group calendar:

Move a task due date by dragging it from one day to another:

Files

11. Easy placing multiple files in a folder:

Check files and drag them at once to a folder:

Book (wiki)

12. Revisions are tracked automatically when Book Pages are updated:

13. Easy overview of differences with the current and previous revision:

14. Easy building hierarchy in Book Pages.

Through dragging you can determine the order of the pages herein you could also make simple hierarchy by dragging a page to another page:

Collaborate with customers

15. Hiding comments for customers

If you work with clients, you can choose at every comment to hide it from the client.

Hidden comments are then given a dark background:

Misc

16. A placed YouTube link will automatically show the video:

17. Everyone can choose their preferred language:

Wrap up

This concludes this edition of Tips and Tricks for OpenLucius, there are many more skills; these are addressed in the next edition. Do you have any questions in the meantime?

Let us know!

Credits header afbeelding

Dec 14 2016
Dec 14

We updated OpenLucius, an open source work management system -contributed as a Drupal distribution. These are the most important improvements:

1.Modern layout for folders and files

The app ‘files’ takes care of central management of files and folders. Prevents messy document management on 'G-drives' and in email boxes. You can see the old layout in this video (we will update it soon):

The new layout:

Top 3 improvements:

  • Added thumbnails of images
  • Mobile ready, so you can tap on file/folder with your finger.
  • See where a file originated from (a message, task, event or ‘isolated file upload’), who placed it and when.

2. New group overview

This is a central view of all content in a group. It has an ‘activity stream’, which lets gives you insight in statistics -and recent activity.

The former group dashboard was a confusing 'hope with content', the new overview provides a better overview of statistics and all activities within the group. Depending on the enabled apps, you can find a summary of the content here.

Tasklist and Taskboard

  • Total tasks.
  • Open tasks.
  • Your open tasks.

Messages

  • Total messages
  • Total messages added last week

Calendar

  • Upcoming events

Book (wiki)

  • Totaal book pages

Members

  • Random members in this group

Social

  • A cover image, logo and description: to give the group an own identity, so users are provided with some cool recognition :)
  • Recent activity stream.

3. Enable and disable apps in a Group | improved design

It turned out that en/disabling apps per group was not clear for many users: the screen was too technical. Hence the re-vamp, including descriptions of what members can do with each app:

4. Boek pagina’s (wiki) re-design

The Book app is a place for documentation, similar to a wiki. Think of a staff handbook, project agreements or project notes. Revisions are tracked automatically, so all group members can contribute safely.

In this video you’ll see the old layout (we hope to also update this video soon).

The new, clean layout:

And the overview of book pages in a group:

5. Group settings | improved layout

Same here, this screen was too technical, causing many users were unaware of its features:

  • Ability to work with clients in a group.
  • Open Group: accessible to everyone.
  • Enter social stuff: cover image, group logo and description.

~37 minor optimizations and bug fixes

There are also minor changes done for optimizations in layout and several minor bugs fixed.

That’s all folks

That’s it for now. If you encounter an issue or have a feature request, please add it in the issue Q on Drupal.org.

Download OpenLucius here for free >>

Thanks in advance, happy collaboration!

Credits header foto

Dec 13 2016
Dec 13

Joris Snoek - Business Dev

+31 (0)20 - 261 14 99

Speed is important in a Drupal website, very important. For visitors as well as search engines, it’s an essential benchmark to success. But how do you keep your Drupal system fast, even when it has millions of pages and documents? Solr is the answer, here is why and how in Drupal 8.

(Dutch version here)

At the moment, we’re migrating a Drupal 7 website to a Drupal 8 system in which there will be millions of pages and documents in the near future. The aim is to have end-users navigate mainly through the search function. That means it has to be extremely fast.

Drupal 8 core contains a great search function, but because this searches standardly in a MySQL database, the search function becomes too slow when the website contains a lot of pages and documents.

Fast search within Drupal 8 with Solr 6

Just to be clear: when you have a Drupal 8 website with a lot of content, the system will be fast enough when you navigate through clicking menu items or links in content/blocks. We’re now talking about the search function and getting relevant search results fast.

Search engine Apache Solr has been Drupal’s friend in this for years. An implementation of Solr ensures a fast search function on your Drupal system and offers extra functions such as:

  • Fuzzy search: spelling mistakes and differences are possible
  • Facetted search: search filters.
  • Rich text-snippets: a piece of text like Google gives you as well, where the search query is highlighted. If you have implemented schema.org, found data will automatically be presented ‘rich’ and placed in the correct context with relevant label.
  • ‘Did you mean…’ function: suggestions for synonyms, or keywords that are close to your search query.
  • Configure the most relevant results from a query, so the visitor sees the most relevant content at the top. Examples from how you can order: content type, comment count, date, sticky, title, headings (h1->h6), body text and lots more.

Especially the fuzzy search is very welcome; Solr really is a beautiful engine and it’s incredibly fast: millions of documents are no problem. Of course, if your servers capacities are configured correctly.

Implementing Solr in Drupal 7 versus Drupal 8

Solr in Drupal 7 is relatively simple to implement, because it has already been developed for years: lots of stable modules are released to produce all sorts of user stories.

In Drupal 8, the integration has already been developed quite a bit, but it’s not yet plug-and-play like in Drupal 7. The design of the architecture has also been changed: you had two important Solr modules for Drupal 7: Apache Solr Search and Search API Solr, both have their own eco-system of modules.

In Drupal 8 the forces were joined, whereby the development became better and extra modules don’t have to choose anymore which eco-system they will build. Modules as Facet API (now Facets), Facet API Pretty Paths, Search API Autocomplete, etc.) can now focus on one implementation instead of two (source).

Implementing Solr in Drupal 8

At the time of this writing, the Drupal 8 Solr module is in beta1, which includes in this case that it is stable enough to put it in, but it's not plug-and-play yet.

Underneath, you can find an explanation of how we got it to work:

The Solr server

We have set up a new VPS, on which Solr is installed. It doesn’t work on the live server of the website, because the concerned hoster didn’t support it.

Besides that, Solr can be managed and secured better on a dedicated, isolated server. By means of opening and closing the right ports, a connection can be made between the public server of the Drupal 8 website and the Solr server.

All other ports are closed using a firewall. You don’t need graphical interfaces, only an SSH access which is secured with keys. There is one GUI: that's Solr's. We blocked that with help of the firewall. You can also do this with help if Linux' IP tables. But make sure to add a service for this, or else you'll loose your security on reboot.

The capacity for the needed Solr server can be calculated, see here.

Install and configure Drupal Solr module

We installed the following modules:

  • Search (core)
  • Search Api - contrib module
  • Search Api Solr - contrib module
  • Composer manager - contrib module, is used for managing external libraries. In this case we are going to install the Solarium lib.

Optional

  • Search Autocomplete - contrib module, this is used so that the search box in the frontend can also be used by the end user to search through Solr. This makes fuzzy search and instant search suggestions relatively easy. This doesn’t work out-of-the-box at the moment, that’s why we have written a custom code for it (see further down this blogpost).

Installation and configuration Drupal 8 connection with Solr

I’m not going to explain the installation of Solr itself in this blogpost, you can find instructions for that here.

1. Installation ‘Solarium’ library in Drupal 8

If you’ve installed the modules mentioned above, you first go to Reports -> Composer manager. There you will see the code that you have to fill in your terminal to install ‘Solarium’ lib.

As soon as you’ve gone through the ‘composer drupal-update’, Solr initially is ready in Drupalrootmap/vendor/solarium:

FYI: you can probably find the ‘Vendor’ file in your GIT ignore file.

2. Add Solr ‘server’ to Drupal 8

  • Go to Settings -> Search and metadata -> Search API.
  • Click Add server and configure the Solr server, an example of the local installation:

Most important settings:

  • Solr version (we use version 6)
  • Port
  • Host

Click ‘Save’ -> Now your Drupal 8 system has a Solr server connection, but isn’t doing anything at the moment.

3. Add ‘Index’

To actually get Drupal content indexed in Solr, you will have to make an ‘index’. Go to Settings -> Search and metadata -> Search API. Click on ‘Add index’:

After you’ve made an index, open it and click the tab ‘Fields’, afterwards click ‘Add Fields’:

Now you can configure the index:

This interface is still a little cumbersome, probably because the Drupal Solr module currently still is in beta1. For example, you can’t see which fields you’ve added to the index, so pay attention to not add the fields multiple times.

It’s a manual task, but it’s fine to do.

You can see the added Fields under the tab ‘Fields’:

4. Configure ‘Processors’

Click the tab ‘Processors’, here you can indicate under what conditions the Solr search has to be executed:

5. Let’s index

Your Drupal content should now be indexed in Solr at a Cron run, you can start this manually. You can see the status:

6. Frontend: queries and search results for end users

This is what it’s all about in the end, search results for the Drupal website visitor:

  • Super-fast
  • Most relevant results on top
  • Spelling mistakes, no problem

Think: Google for your own website ;)

The modules that are available for this don’t work good enough (yet) for our implementation. It didn’t seem to work with Views either, you can configure an ‘index View’, but that didn’t give any results.

Custom code seemed to be the best option at the moment; to get the global ‘Search autocomplete box’ to work as well.

>> Check the code on Github here >>

Explanation of some code snippets

For explanation: see code comments, herewith are some code snippets explained:

hook_page_attachments_alter is to solve the bug from Input field value is not sent with the AJAX request when using URL call back with custom view and exposed filter. The search autocomplete is only able to use contextual filters. With this hook, you can use your own filter (or set a default).

The LuciusSolrController is divided in:

__construct for making, there’s a @todo in here.

$config = \Drupal::config('search_api.server.solr');

This actually must not happen and has to come as a service. (because of dependency injection, which is missing for this part).

create

Different services are added here (injected in the container).

search

We build the custom search here, this function has a second $processing_callback which should be used for the autocomplete version, but which still has to be adjusted.

lucius_solr_autocomplete_doc_processing

This is for the construction of the autocomplete results.

lucius_solr_autocomplete

This would have to invoke the lucius_solr_autocomplete_doc_processing callback.

getSolrConnector

Function for downloading the solrConnector.

prepare_solr_query

Function that the query fuzzy makes and cleans up using an xss filter. Probably other things have to be done here for contains etc. but for now fuzzy is sufficient. (Possibly contains has to be in the search).

Beta

This module is also still in beta, what means that it should be tested extensively, on speed, safety, stability and documentation.

I can imagine you have questions about it, let us know.

Frontend search results screenshots

Since the Drupal 8 data contains private data, we can’t show those results, instead here are a few simular screenshots from a Solr implementation in OpenLucius (a work management system contributed as a Drupal distribution).

Auto complete search box

Search results including in-document search

With help of Apache Tika to index attached document content (doc, xls, pdf, zip, etc):

FYI: Data collections in Solr

You can make data collections in Solr if you want to index more than one website or external data source or if you want to make them more searchable, then it’s good to do that in different data collections. Depending on your version of Solr, it’s also called:

  • Core (Solr v4)
  • Shard/collection (Solr v5)
  • Collection (Solr v6)

To summarize

Does your Drupal website contain a lot of content and documents? Solr helps big time. In Drupal 7, this integration already was very developed and relatively easy: no need for a custom code.

In Drupal 8, this implementation is also available in beta1, custom code is still needed to get the results as you like on the screen of the Drupal website visitor. I will not be surprised if you won’t need custom code anymore in a few months, because the Drupal community constantly works hard on the Solr modules.

Header image credit

Sep 16 2016
Sep 16

The 'Popup question redirect' module allows Drupal site builders to show website visitors a pop-up in which a question can be asked. If the vistor clicks "Yes" they will be redirected to a given webpage.

Sep 13 2016
Sep 13

We've updated OpenLucius, a Drupal social intranet / work management system. This is the most important new stuff we built for you:

1. Board

We added a new app: Board. In this Kanban board you can collaborate on tasks more easily and efficient:

  • Inline add and edit tasks (cards).
  • Drag and drop to change status.
  • Drag and drop to change priority: highest placed task has highest priority.
  • Inline changing of due date.
  • Inline changing of assignee.
  • View task in modal / pop-up, so you’ll keep the board in the background.

Administer task statuses and their order

If you are an admin, then you can manage the statuses and the order of it yourself:

2. More user friendly because of interface optimization

All pages got quite a facelift.

3. Update activity stream and status updates

The group activity stream and status updates got a big update, it’s now possible to like and comment inline. It automatically collapses comments and more of this fancy interactive stuff.

3. Adding tasks faster and easier

You can now add a task from any page in OpenLucius and therefore don’t need to navigate to a specific group for this. You can add a task from any page by typing letter ’t’ or select 'Task menu' => 'Add new task’.

Handy: if you are navigating in a group, then that group is automatically selected.

4. Easier to work on tasks with modal screens

If you add a task or open it, then it’s nice if your underlaying list (calendar, task list, or board) is not lost. So tasks now open in a modal / pop-up, so you son’t lose your underlaying overview -thus navigating easier and faster.

5. Instant insight into projects and tasks: reports

See how budgets on projects and tasks are doing:

  • Tasks that are due.
  • Insights in budgets of projects.
  • Time overviews where you can see exactly who worked how long on what.

Reports menu

Budget overview per group

Time overview per user

  1. Total tracked time for this user (4) in this date range (5)
  2. Breakdown of tracked time in hours per day
  3. Filter on status todo
  4. Filter on user
  5. Filter on date range
  6. Aggregated time, clustered by 'time type'. You'll also see the percentage of 'effective time' tracked (see also).
  7. Breakdown of tracked time in percentages for each todo-list
  8. Breakdown of tracked time in percentages for each todo-list, clustered by 'time type'(See also set budget and 'time type').
  9. Breakdown of tracked time per day per todo
  10. All Todo-lists with budgets and total tracked time in that Todo-list

6. Insight into project budgets; overhead and effective time

You can now add a budget per group and choose whether it’s effective time or overhead. During a project, you’ll have realtime insights in group 'Budgets':

  • How much of the budget are spent and where.
  • Insight into effective time and overhead.
  • Click through to see more details: how much time is spent on wich tasks.

7. 'Text Document' => 'Book Page’

We received feedback that the title of the app Text documents was confusing. This app is used for example for:

  • Handbooks.
  • Documentation projects.
  • Meeting notes.

After a survey we found Book (with underlying Book Pages) the best choice.

8. Various tuning and fixes

Furthermore, we did ~60 smaller fixes for optimization, usability and stability.

Aug 22 2016
Aug 22

Joris Snoek - Business Dev

+31 (0)20 - 261 14 99

Here’s what struck me last month about Drupal modules. This month I have chosen to focus on Drupal 8 as this is slowly becoming the go-to version - partly because many required modules have been migrated and grown up.

1. Require Login

Make sure all your visitors on your Drupal website are obligated to log in. Handy for a Drupal intranet or social communities. It is possible to exclude certain paths so that they are publicly available.

Download

2. 403 to 404

Mini module that ensures you will get to see a page not found on an access denied page. This way others will not found out that this page is an administration page.

Global redirect contains a similar feature.

[edit]
Comment from Adam Evertsson:

About 403 to 404, you write that Global Redirect has a similar feature. There isn't a Drupal 8 version, and that functionality has been included in the Redirect module, https://www.drupal.org/project/redirect
[/edit]

Download

3. Block tabs

Add tabs in blocks in order to cluster information. Similar to the Quick Tabs module. But Quick Tabs has no version for Drupal 8. Furthermore Block Tabs is offering integration with the Drupal 8 API, plugin system, block, entity and config API. Add CSS yourself to adjust the tabs according to your house style.

Download

4. ShareThis

Do you like to have social buttons so people can easily share pages on Facebook, Twitter and LinkedIn? Integrate the ShareThis social bookmarking service in your Drupal 8 website using this module to get you socialized in no time.

Download

5. Page Load Progress

Some heavy activities in a Drupal website can take a few seconds. In these cases it is preferable to lock the screen to avoid impatient users clicking other features. You can show a throbber and thus lock the screen using this module.

Download

6. Adminimal Admin Toolbar (Drupal 8)

The Drupal 8 admin toolbar is fine, but could be better. This version is inspired on the popular module Adminimal Administration Menu

Download

7. Node Order

Manually organizing nodes within a given Drupal taxonomy term. By default Drupal is sorting on sticky and date created. Using this module you can determine the order yourself.

Download

8. Mail system

This popular module is migrated to Drupal 8. This allows the administration of all kinds of actions related to sending an email from Drupal 8. For example:

  • Formatting of emails in HTML
  • Managing email per Drupal module
  • Templates for e-mails

Download

9. Optimizely

Everybody should constantly be A/B testing for conversion optimization. Optimizely.com is such an A/B testing tool that integrates in your Drupal 8 website using this module.

Download

10. Menu block

Drupal 8 has standard features to place menus via blocks in your website. But it misses some features that are complemented by this module:

  • Determine how many menu levels you want to show
  • Set initial menu level
  • Expand all Drupal menu items

Download

11. Update External Links

Open external links in text automatically in a new window to avoid people navigating accidentally away from your Drupal 8 website. Similar to the modules External links and External New Tab

Download

12. Pinterest Hover button

Simple module that let’s you show automatically a pin it button as soon as website visitors hover over an image. Now also available for Drupal 8.

Download

13. Easy Social

Similar to the above mentioned ’ShareThis’: make it easy to share your Drupal 8 content on social media platforms such as Twitter, Facebook and LinkedIn. This module is not using an external service unlike ‘ShareThis’.

Download

14. Chosen

Makes selecting items (f.e. Drupal taxonomy terms) easier for content managers in your Drupal system. Now available for Drupal 8.

Download

Wrap up

OK, that’s it for now, stay tuned for more interesting Drupal stuff and next month again a cool Drupal modules update!

Credits header foto
Credits mail foto
Credits social foto

Jun 14 2016
Jun 14

By: Henk van Cann

What is bitcoin and how does it work — watch video
What is the blockchain — watch video
Why should we care about the blockchain — read blog post

How can a blockchain be meaningful for a CMS like Drupal? — keep reading.

Famous speech of John F. Kennedy, president USA in 1960’s ‘what you can do’

Abstract

The title is the abstract. The article is aimed at current reputable CMS web-based frameworks like Drupal, Wordpress, Joomla, Hippo, Rails, Django, etc.

Why this blog post?
Dries Buytaert creator of Drupal raised a simple, yet extensive question on twitter (‘@Dries’):

“What could the Blockchain mean for a CMS like Drupal? #brainstorm”

Let us analyse this question step by step. And then come to a surprising conclusion: it is much more interesting for Drupal to change the question.

“The Blockchain“ is written with a capital ‘B’ and if that is done on purpose, it refers to the Blockchain protocol and the word ‘the’ implies that we look at the blockchain under the hood of the bitcoin, running the Bitcoin protocol. Focus makes life easier.

Besides technical features, public blockchains are expected to have a political and ideological impact. I choose the more technical approach in this blog post, for the sake of clarity, practical application and more focus. (Which again makes life easier.)

A CMS manages content on the web, using a permissioned and centralised database. However, a public blockchain is a verification machine without the need of a middleman and offers pseudo-anonymous permissionless access to a single global ledger. Big difference…

Aren’t there any commonalities? Sure! Drupal shares the following features with The Blockchain:

  • internet based
  • open source
  • for free or at very low costs
  • a developers community

The bitcoin blockchain differs from a CMS like Drupal:

  1. it is not a web-application
  2. it is an explicit transactional system, unlike the content store that a CMS is, as it uses implicit transactions
  3. it does not contain a relational database
  4. it is slow
  5. it has a low transaction rate (7 tx/s)
  6. it consumes an enormous amount of energy
  7. transactions are irreversible, meanwhile CMS database changes are reversible

Fremdkörper

A blockchain would be a “fremdkörper” in a CMS

So back to the question “What could the Blockchain (of the bitcoin) mean for a CMS like Drupal?” Not much at the moment. Because the true nature of a web based CMS like Drupal, Wordpress or Joomla is so different from a blockchain, that adding blockchain features to the CMS environment, would be like introducing a fremdkörper: a component or additive that renders something else that is impure.

It makes no sense to add inefficient decentralized features (for the sake of freedom) to a centralized, highly efficient content management system.

Examples of Drupal modules that learn(ed) this through experience:

Well, if it there is no clearly identifiable match, what to do instead?! The Drupal community somehow must anticipate the blockchain-tsunami that we anticipate.

Brainstorm

This is what any open source CMS community could think about the following issues: Which problems do we want to solve (with a blockchain) that could not be solved before? And why would we need an inefficient intermediate-less worldwide verification machine to do that? What freedom do we strive for that we could not reach before?

  1. in the core of our framework
  2. in the components of our framework
  3. in the implementations of framework + components

Let’s take a pretty straightforward example: webshop components (2.). Every CMS has them. We all recognise the high costs of international money transfers. Whether you use a payment provider or not, transferring and receiving small amounts of money will have a substantial percentage of “wasted money” paid to middlemen (pp’s and banks). <- suppose we consider this as a problem we need to solve.

If we would accept bitcoin in the web shop (and not use the bitcoin-service of any middleman), we would need to provide functionality:

a. wallet-functionality,
b. exchange to and fro fiat currency,
c. transaction (confirmation /validation) functionality and workflow.

Yes, we would need an intermediate-less verification interface to the Blockchain. However: No! This would not significantly add anything to the freedom we already have available. Nowadays, there are many payment service providers that offer bitcoin payment services. Their mutual competition will settle a decent price for you that matches current economics. As a component builder for Drupal, you just have to pick one or switch to one that does a good job.

Blockchains introduce other problems and inefficiencies.

Conclusion of this example: We don’t need to address a blockchain ourselves to improve payment providing. And by doing so (use a blockchain directly), we would introduce other problems and inefficiencies.

Most of the times we do not need a blockchain

Go over every use case a dozen times. Most of the times, we do not need a blockchain. I learned that the hard way from bitcoin Core developer Peter Todd. If you’d like to know more, read the blog post ‘Approach Blockchain Enthusiasm as a Devil’s Advocate’.

Identity, never a dull moment

Any other problem that we have that we could solve with the blockchain? …

Pretty quickly, people will come up with ‘Identities’! Dave Birch, the writer of ‘Identity is the New Money’ (2014), recently said: “Every discussion about the blockchain boils down to Identity issues within 1o minutes.” And it really does! Visit any blockchain meetup, conference, brainstorm session, Proof of Concept or whatever, there is never a dull moment around Identity & Access Management.

How come? And could we tackle this with blockchain? Are we better off now the Bitcoin proofed to be stable?

The authentication and authorisation of e-identities is a trade off everywhere on the web between between privacy, efficiency, security and ease of use. More specifically, e-Identity is an area of interest that has a theoretically and fundamentally love-hate relationship with public blockchains. That’s one angle to consider. However, the other perspective is that there seems to be hardly any killer app discovered for e-Identity that benefits from a blockchain. Or at least no killer app where CMS frameworks like Drupal could benefit from directly.

Let us turn the question around: What can Drupal mean for the Blockchain and any other blockchain? A lot! Blockchains are in their early stages of development. And here is the shocking answer: A whole lot, right away!!

My bet: Build Drupal connectors (modules) for anything that public blockchain developments need. That applies to the Bitcoin Core of course, but also to exchanges, portfolio management tools, wallets, BaaS (yes, yes), etc.

They all suffer from these needs:


1. to bring the blockchain functionality to a bigger audience (e.g. two-way pegged side chains, the lightning network, hyperledger)
2. to improve the UX (blockchain apps have GUI’s that brings us back to the last century)
3. to improve the workflow (blockchain implementation are in their infancy)
4. to improve the safety (unintentional mistakes can be very costly because they are irreversible), etc.

One for the Drush road

Most development environments for blockchains are command-line based. One could consider extending Drush with Core blockchain-specific commands or features.

Conclusion and my ‘2 cents’

Don’t ask what the blockchain can do for you, ask what you can do for the blockchain! That will effectively bring any reputable framework into the blockchain game. And your community could start learning while continuing to rely on the own strength the framework has had for years. Step by step, with not too much at stake.

My ‘2 cents’: Build bridges, connectors, components, API’s, user-friendly front-ends to blockchains and watch all of these tools either flourish or die. Leave public blockchain Cores for what they are: rather inefficient global verification machines based on cryptography and time-stamping.

Colophon
Imaginary acknowledgements / thanks : middle

Jun 11 2016
Jun 11

We updated OpenLucius yesterday, these are the most important changes:

1. Main menu

On many requests, we have given the work management in OpenLucius a more prominent place. Work management is mainly about your assigned tasks, these are more accessible now:

2. Order apps per group

You can now specify the order of the enabled Apps in a group. The first placed App will open automatically when you open a Group.

3. Choose language

Everyone can choose preferred language now:

4. Manage status updates

You can now manage your own status updates:

5 'Save' button disabled after saving

When you hit the 'Save' button it will be disabled, so you don't accidentally add the same item several times.

6. '+Folder' on group dashboard next to 'Files' heading

An additional button is placed: to create folders fast from the dashboard in a group.

7. Manage and order your own 'Todo statuses'

If you are an admin, now you can configure your statuses under 'configration':

miscellaneous

  • ~ 30 small fixes and optimizations

Credits header foto

Jun 07 2016
Jun 07

In this blog serie I will explain how we have built a new multilingual Drupal 8 site. During the process the required HTML, CSS en Javascript was supplied statically and used to build a custom Drupal 8 theme. So we did not use a Drupal core or contrib theme.

We are talking about this website:

This Drupal 8 website consists of pages that are built up from Drupal blocks. Therefore I will explain in detail how we have built these blocks. Furthermore this Drupal 8 website is multilingual: Dutch and English. As listed below I will explain:

  1. Generic structure of a Drupal 8 theme
  2. Initiation Drupal 8 theme and placing supplied assets: CSS, JS, fonts and images.
  3. Breaking down supplied HTML into Twig template files (.html.twig files).
  4. Determination of the Drupal regions.
  5. Building homepage HTML using blocks, and Drupal and Twig template files.
  6. Building contact page using blocks and Drupal 8 core contact form.
  7. Building other pages using Drupal 8 blocks.

Basic knowledge

I assume you already have some experience with Drupal:

  • Installation and general configuration of the Drupal 8 core, modules and themes.
  • Configuration of content types

Drupal 8 theme | The structure

What is a Drupal 8 theme

A theme is a collection of files that determine the look of your Drupal website: what the visitor sees. Only 1 file is required, the .info.yml, but for a complete theme more files are needed.

Drupal 8 uses by default PHP templating engine Twig, part of the Symfony framework where Drupal 8 is built on.

Where do you insert the theme

When creating a custom theme, this is inserted in the /themes folder. Be sure to put the Drupal core themes in the folder /core/themes. Never ever do you put your own theme there, that would be a core-hack: a crying shame.

To keep your themes folder organized, it is a best practice to divide them in the folders:

  • /contrib: place here all themes downloaded from Drupal.org
  • /custom: place here all themes that you are building yourself.

Each individual theme is inserted in a folder with the name of the concerning theme. That name can only contain lowercase letters, must start with a letter and use underscores (_) instead of spaces.

The (partial) structure for our installation will look like this:

|-core
| |-modules
| |-themes
| | |-bartik
| | |-seven
..
|-modules
|-themes
| |-contrib
| |-custom
| | |-openlucius

Which files are part of a Drupal 8 theme

As indicated, a useful theme will contain more files then just the mandatory THEMENAME.info.yml.

About .yml files

Yaml (.yml) files are files intended for data and not for markup. These are not necessarily Drupal 8 specific files: they are also used in other programming languages such as C, Perl and Python. Within Drupal 8 they are mainly used to include definition and configuration; part of the Configuration Management Initiative

A Drupal 8 theme has the following structure:

|-THEMENAME.breakpoints.yml
|-THEMENAME.info.yml
|-THEMENAME.libraries.yml
|-THEMENAME.theme
|-config
| |-install
| | |-THEMENAME.settings.yml
| |-schema
| | |-THEMENAME.schema.yml
|-css
| |-style.css
|-js
| |-THEMENAME.js
|-images
| |-background_frontpage_header.png
|-logo.png
|-screenshot.png
|-templates
| |-maintenance-page.html.twig
| |-node.html.twig

THEMENAME.info.yml

This is the only mandatory file of the theme, that defines the theme and that is recognized by Drupal 8. Extra ‘meta data’ is also placed here, such as:

  • description: short description of the theme.
  • libraries: which libraries are where.
  • block regions: defined regions, see below for more info.
  • overrides: which Drupal 8 core services do you want to override and where are these overrides.

THEMENAME.libraries.yml

Defines the Javascript and CSS libraries used by the Drupal 8 theme.

THEMENAME.theme

Contains PHP code where preparatory logics can be programmed: (pre)processing of the HTML output.

THEMENAME.breakpoints.yml

Breakpoints are points on which a responsive webdesign should change to be displayed properly across devices. These breakpoints can be defined here.

/templates/

The template files implement the HTML code for your Drupal 8 website. Drupal 8 template files have format THEMENAME.html.twig and must be placed in this subfolder (unlike Drupal 7).

The Drupal 8 core provides a number of template files. If you maintain certain naming conventions for template files in your own theme, then Drupal will automatically use your templates instead of the core templates. Allowing you to override the HTML markup.

Place for example the file node.html.twig in this folder and Drupal will use your version instead of the core version: /core/modules/node/templates/node.html.twig

/css/

It is a best practice to place .css files in the subfolder /css. Drupal 8 core themes structure CSS files in accordance with the SMACCS style guide. CSS files should be defined in the .libraries.yml file and can be override or disabled in the .info.yml file.

/js/

This folder contains the Javascript files of the Drupal 8 theme. To load them, they should also be defined in the .libraries.yml file.

/images/

It is a best practice to place theme image in this subfolder. Don’t confuse it with content images.

screenshot.png

When you insert this image, then it will appear on the Appearance backend page in Drupal 8. The location of screenshot.png could be placed somewhere else; that alternative location should then be defined in the .info.yml file.

logo.svg

The logo of your website, that is usually shown in the header to your visitors. This logo can also be uploaded in the Drupal 8 backend under Appearance > Settings

Subthemes

Within Drupal 8 it is also possible to work with base-themes and sub-themes. Subthemes are just like other themes with the difference that they inherit resources from the base-theme. It is even possible to create sub-sub-themes and sub-sub-sub-themes (and so on).

In this tutorial I will not discuss sub-theming in Drupal 8 any further.

Drupal 8 theme structure | Regions

As the word implies: a region is a certain region in your Drupal 8 website, which is used to place content. More detailed: this content is added in blocks, that are placed in regions. A block can be seen as a building block; regions give your Drupal 8 website the layout to place your blocks (meaning the content).

Regions are defined in the theme in the .info.yml file

Drupal 8 core regions

Drupal 8 knows the following standard regions:

  • page.header: Items for the header region.
  • page.primary_menu: Items for the primary menu region.
  • page.secondary_menu: Items for the secondary menu region.
  • page.highlighted: Items for the highlighted content region.
  • page.help: Dynamic help text, used mainly for admin pages.
  • page.content: The ‘main content’ of the current page.
  • page.sidebar_first: Items for the ‘first sidebar’.
  • page.sidebar_second: Items for the ‘second sidebar’.
  • page.footer: Items for the ‘footer region’.
  • page.breadcrumb: Items for the ‘breadcrumb region’.

If your custom theme does not define regions, then you will have these at your disposal.

Hidden regions

When you go deeper into Drupal 8 theming, then you will also get to see these regions:

  • page_top
  • page_bottom

These are hidden regions and can be seen in html.html.twig, a template file that is usually not overridden in a custom theme. These regions are used to place HTML entirely at the beginning or the end of the page, for example:

More info about regions

Can be found here.

Drupal 8 theme structure | Template files

Template files contain the HTML that is eventually sent to the browser of your website visitor. These are all files with extension .html.twig. If you look at the template files of the Drupal 8 core theme ‘Bartik‘, you will see the following:

These files all follow a by Drupal 8 determined naming convention so that Drupal knows which template file to use for what. This can range from an entire page, to theming a block, to theming one small select element. In fact, all html generated (or additionally required) by Drupal core can be changed to custom HTML. Creating a theme with supplied, so 100% custom, HTML is therefore possible.

The template files are divided into:

  • HTML for the header
  • HTML for the page
  • HTML for regions
  • HTML for blocks
  • HTML for nodes
  • HTML for taxonomy terms
  • HTML for fields
  • HTML for comments
  • HTML for maintenance page
  • HTML for search results

As an example, these are the naming conventions for the node template files:

  1. node--nodeid--viewmode.html.twig
  2. node--nodeid.html.twig
  3. node--type--viewmode.html.twig
  4. node--type.html.twig
  5. node--viewmode.html.twig
  6. node.html.twig

Per page Drupal will run this list from top to down, the file that is first defined in the theme, will be applied by Drupal to the appropriate item.

See here an overview of all template naming conventions.

In case this should all be a little too abstract, don’t worry: in the actual implementation that is discussed further down in this blog, everything will become clear.

Implementation custom Drupal 8 theme | Initiation

Installation Drupal 8

We are starting with a new Drupal installation. Download and install Drupal 8 from this page, or install via the Drupal console with site:new.

Initiation Drupal 8 theme

In the initiation phase the following theme structure was made: the required folders and files were placed in drupal8 root/themes/custom/

openlucius
|-css
| |-base
| | |- css files
| |-components
| | |- css files
| |- mobile-overrides.css
| |- overrides.css
|-fonts
| |- font files
|-images
| |-backgrounds
| | |- images
| |-flags
| | |- images
| |-glyphicons
| | |- images
| |-gradients
| | |- images
|-js
| |-base
| | |- javascript-files
| |-components
| | |- javascript-files
|-templates
| |-block.html.twig
| |-block--system-branding.html.twig
| |-block--system-menu-block.html.twig
| |-node.html.twig
| |-page.html.twig
| |-page-title.html.twig
| |-region--header.html.twig
| |-status-messages.html.twig
|-logo.png
|-openlucius.info.yml
|-openlucius.libraries.yml
|-openlucius.theme

Inserting supplied assets of the theme

All supplied assets of the theme are divided into the following folders:

  • /css
  • /javascript
  • /images
  • /fonts

openlucius.libraries.yml

All CSS and JS files need to be recognized by Drupal, this is done in openlucius.libraries.yml, with us this is looking as follows:

openlucius.theme

Additional logics that is required before rendering the HTML, will be placed here.

Not implemented: openlucius.breakpoints.yml

We did not use this file, as necessary breakpoints have already been supplied to the implemented static HTML/CSS.

Enable the Drupal theme

In the Drupal 8 backend go to ‘Appearence’ and click ‘install and set as default’ at the new custom theme.

Theme initiation done

The Drupal 8 theme is now initiated, but at the moment only an ‘empty’ page can be seen. In the following blogs I will fill the page by inserting the HTML through blocks.

May 31 2016
May 31

We just released an update of OpenLucius, a drupal social intranet distribution. Check out the new and improved stuff:

1. Choose enabled ‘apps’ per group

It is now possible to disable or enable apps per group:

2. Local tasks to drop down

To keep the screen clean, we moved tabs to a minimalistic drop down:

3. Inline edit todo’s on dashboard

To work faster, you can now edit a todo inline:

4. Long items in the activity stream

Will now be shortened:

5. Files in activity stream

Will now show up, they didn’t before:

6. Todo digest email

Removed unnecessary header footer and texts

Misc

We also fixed ~30 minor issues

Credits header photo

May 27 2016
May 27

Without further ado, here is what struck me about Drupal modules in the past month:

1. Hide submit button

Avoid duplicate content because people are clicking twice on the Save button. This module ensures that the Save button cannot be clicked more than once, by making it unusable after the first click.

Dowload (Drupal 7)

2. Magnific Popup

Automatically creates a beautiful, fast gallery with images. With capabilities to enlarge the images in various ways.
It uses lightweight jQuery lightbox library Magnific Popup and implements a Drupal field that lets you add images to content..

Download (Drupal 7 & Drupal 8)

3. Mail Verify

A better way to verify entered email addresses. The Drupal 8 core only verifies based on format, this module verifies in a totally different way: it tries to connect to the relevant email server to check if the entered email address really exists.
Do not use this module as a primary protection against spam, otherwise you risk the server from becoming greylisted. So for web forms (f.e. contact, signup) use for example Mollom and Honeypot as primary spam protection.

Download (Drupal 8)

4. Search exclude nid

It may be necessary to exclude certain nodes from the search results in Drupal, simply because they are not relevant.

Download (Drupal 7 & Drupal 8 dev)

5. Facebook Comments Block

Provides the possibility to place Facebook comments on pages in your Drupal website. Several modules are available for this, but this one makes it easy with its simple configuration. This Drupal 8 module also uses the system path (node/xx) and not the url alias, preserving existing comments; also when you are changing the url alias.

Download (Drupal 7 & Drupal 8)

Related module: are you changing the url alias of a Drupal page? Make sure you have installed the Redirect module, so that it automatically creates a 301-permanent redirect. This way you keep the SEO of the concerning Drupal page intact.

6. Require Login

Make sure your entire Drupal site is protected: all visitors must sign in before they are able to see content. Handy for a Drupal social intranet or for separating testing environments.

Download (Drupal 7 & Drupal 8)

7. Dynamic Entity Reference

A Drupal module that allows you to create an entity reference field and lets you reference to multiple entity types instead of only one.
Download (Drupal 7 alpha & Drupal 8 rc4)

8. Field Hidden

Provides the possibility to add a ‘hidden’ field: < input type="hidden" / >. Visitors don’t see this field, so you can use it to add hidden information to forms, usually system information.
Download (Drupal 7 & Drupal 8)

9. Double field

Similar to the Field collection module, but then light weight: split up your field in two parts. An example why this can be handy:

Download (Drupal 7 & Drupal 8 rc1)

10. Classy paragraphs

Sometimes you want to optionally add an extra class to a specific paragraph in Drupal content in order to give it the right styling. But you don’t want to tire your content managers with writing HTML.
This module provides the solution: It generates an additional button in the text editor, that lets Drupal add an extra HTML class to a selected paragraph.
Select the styles you like to have available.
This module is depending on the Paragrahs.

Download (Drupal 7 beta1 & Drupal 8 alpha1)

11. Supercookie

Within the Drupal core it is difficult to track all the unique users, especially when they are all visiting your Drupal website from 1 location (so 1 IP). This is due to the way the Drupal core handles sessions and cookies.
This module implements another way for Drupal to handle cookies, a way that lets you track all the unique users from your Drupal website.
This information can be very useful for marketing purposes.

Download (Drupal 7 & Drupal 8)

12. Serial field

Add a field in which the numerical value rises automatically, regardless of Drupal's ‘node ID’ auto numbering. This can for example be useful for invoice numbers. This field can be divided into different types of content; the values will remain unique, all the way through those content types.

Download (Drupal 7)

Wrap up

Alrighty, that's it for now. Next month again a blog about 'Cool Drupal modules', so stay tuned!

Apr 22 2016
Apr 22

Let’s start straight away with the things that struck me about Drupal module updates of last month:

1. Image effects

The Drupal 8 and Drupal 7 core both have features to facilitate graphics, including scaling and cropping.

To perform other actions, Drupal 7 had additional modules: ImageCache Actions and Textimage:

  • Placing overlays, for example for round corners
  • Adding a watermark, for example your logo
  • Placing text over image, for example your company name
  • Making images lighter/darker

In Drupal 8 these additional image features are now available in this module.

Download

2. Currently logged in users

Provides a list of logged in visitors with additional information, such as:

  • Since when logged in
  • Hostname
  • IP address

You can also force users to log out when you are a site admin.

Download

3. Drop down login

Create space on your page and place the login block under a dropdown button.

Download

4. Views Send

Do you want to send a bulk email to a selection of users in your Drupal website? For example to inform them about an update? Through this module you can use Views to make a selection and then use fields from that selection to send personal bulk emails.

Download

5. Google Analytics Reports

Provides a graphic report of page visits to your Drupal website using data from Google analytics. Has been around since 2011, but just had a stable 3.0 release.

Download

6. Quick tabs

Simple, but effective and popular to create tabs in content on your Drupal website.

Download

7. Bootstrap Site Alert

Are you running a Drupal theme on the Bootstrap HTML framework? Great! Then you can now easily display a message at the top of your website - through this module. For example to inform users about upcoming maintenance or a performed update.

Download

8. Code filter

An alternative for the Geshi module: gives the correct highlighting to code in your Drupal content.

Download

9. AJAX Comments

By default Drupal has a good system for comments/responses, but when someone is giving a response (for example to a news item) then the page will always load again. The response is not instantly placed underneath the item, like for example Facebook is doing.

This module ensures a response will be placed without refreshing the page.

Download

10. User IP log

Convenient administration module that stores IP’s from logged in Drupal users. This let’s you analyze if there is suspicious activity.

Download

11. Views Accordion

Simple but popular module, similar to the above mentioned ‘Quick tabs’: this makes an accordion of Views results.

Download

Apr 19 2016
Apr 19

The past month we have processed again a lot of feedback and improved OpenLucius, a Drupal social intranet. Below the improvements that have been made yesterday:

1. Navigation text documents better and faster

We noticed that the navigation of text documents was loading slowly - when placing a lot of text documents (100+) in a group. This is now loaded with a different technique that makes everything much quicker.

We also addressed the navigation to sub-pages (1): this is now more intuitive, faster and mobile usable. Finally, we placed a search feature above (2), so you can find/filter documents quickly.

Read more about text documents >

2. Hide comments

We received a lot of feedback that a page with many comments was becoming unnecessarily long and cluttered. We solved this by hiding comments - just like Gmail does. Hidden comments can easily be shown again.

3. Improved status updates

It is now visible who placed Likes and also images can now be enlarged.

4. Changing profile made easier

When changing your profile, the information is now divided into tabs. Before the update all the profile fields were shown below each other.

5. Event information

All information about an Event is now shown immediately, instead of in separate tabs.

Read more about Events >

6. Adding To do’s from Group dashboard

When adding a To do from a Group dashboard, you will return there again after saving. Also the date field is now by default empty.

Read more about To do’s >

7. Icon: ‘Visible to client’ improved

This icon is now only displayed when the relevant content is placed in a group, specified as ‘Group with clients’.

Read more about collaborating with clients >

8. Images in text

Images posted in text are now also scaling well on a mobile device.

9. Easily change your picture and cover image

Change your picture or cover image instantly by moving your mouse over them and clicking ‘change cover image' or 'picture icon'.

10. News tab front page

We have added a ’Show more’ feature. You can see now also who gave the Likes.

Read more about the News tab >

11. Notifications optimized

The button ’Show more group members’ (under notification marks) is now only shown once.

Read more about Notifications >

12. Translations

Some missing Dutch translations have been added.

Wrap up

That’s it for April, questions or feedback? Let me know!

Apr 06 2016
Apr 06

Na het lezen van het boek 'Dit kan niet waar zijn', de bestseller van Joris Luyendijk, vroeg ik me af: hoe zal ons financiële stelsel er over 10~20 jaar uitzien? Het boek schetst ons namelijk een duistere financiële toekomst: een volgende crash lijkt in zicht. De Oscar winnende film 'The big short' bevestigt dit vermoeden.

Tegelijkertijd is mijn partner Henk van Cann zich aan het verdiepen in de cryptocurrency wereld en schetste mij wat deze valuta betekent voor de toekomst: nérgens meer tussenpersonen, dus ook geen bankiers meer.

Mic drop.

Bitcoin en andere cryptovaluta, een nieuw mensenrecht

Het meest bekende 'cryptogeld' is momenteel de Bitcoin, maar dit is slechts één voorbeeld; het topje van de ijsberg.

Huidige manier van betalen vs Bitcoin

Veel websites en winkels ondersteunen al betalingen met Bitcoin, enkele redenen:

  • Geen risico op diefstal van credit card data.
  • Klanten hebben vertrouwen in hoeveel ze exact betalen (geen wisselkoersen).
  • Geen onbevoegde transacties.
  • Lage transactiekosten (uiteindelijk zullen deze zelf gratis zijn).
  • Directe transactie, opnieuw besteedbaar na ~ 10minuten voor kleine bedragen.
  • Geen sancties toepasbaar, je kunt dus bijvoorbeeld geld versturen naar Iran.
  • Concurrentievoordeel door de wet van remmende voorsprong: grote webwinkels als Amazon, Airbnb en Bol.com zullen voorlopig nog geen Bitcoin betalingen ondersteunen.
  • Aandacht in de media: als je de eerste bent in jouw niche, dan zal de media over je gaan schrijven omdat ze geobsedeerd lijken door Bitcoin. Dit is tevens goed voor je zoekmachine optimalisatie.
  • Dubbel uitgeven van geld is onmogelijk.
  • Geen tussenpersoon nodig, je hebt dus geen abonnement nodig voor transacties. ==> Een nieuw mensenrecht is geboren.

Wat is de Blockchain?

De onderliggende techniek van Bitcoin is de ‘Blockchain’ en deze kan voor álle soorten transacties ingezet worden. Die transacties worden in de hedendaagse wereld uitgevoerd door tussenpersonen (trusted 3rd parties) zoals:

  • Banken
  • Accountants
  • Notarissen
  • Overheden
  • Debiteurenbeheer
  • Chartaal geld

In essentie is de Blockchain een netwerk van computers (‘miners’) die zorgen voor controle en registratie van transacties. Dit netwerk vervangt huidige tussenpersonen.

Complexe algoritmes worden toegepast om betreffende transacties te verifiëren; dit systeem is niet te kraken.

Als een transactie eenmaal goedgekeurd wordt door deze miners, dan wordt hij onomkeerbaar bijgehouden in een oneindig durend register (de ‘ledger’), die opgeslagen staat bij alle computers in dit netwerk. De geaccordeerde transactie wordt daarna vergrendeld en gegevens ervan worden opgeslagen in deze oneindige boekhouding. Wat bijvoorbeeld geregistreerd kan worden:

  • Tijd van de transactie
  • Datum van de transactie
  • Betrokken partijen
  • Gemaakte afspraken
  • Hoeveelheid
  • ... en alle andere informatie wat nodig is voor een bepaalde transactie

Deze gehele boekhouding van transacties is openbaar geregistreerd bij alle computers in het netwerk en dus niet in beheer bij één tussenpartij -zoals nu wel het geval: banken, notarissen, overheden, etc.

Shared single source of truth

De gehele boekhouding van transacties (de ’ledger’) wordt tevens continu gecontroleerd en geaccordeerd door al deze computers.

Als iemand de ledger probeert te wijzigen (fraude probeert te plegen), dan zal die anomalie meteen opvallen. Die transactie wordt dan ook niet geaccepteerd.

De blockchain heeft dus een ‘Shared single source of truth’.

Nogmaals, de Bitcoin is hier slechts één voorbeeld van. Alles wat waarde heeft kan opgenomen worden in de Blockchain:

  • Contracten
  • Huizen
  • Stembiljetten
  • Energie
  • … you name it

Ook Twitter, Facebook en Uber kunnen vervangen worden

De Blockchain technologie is een autonoom, onbreekbaar systeem en kan dus tussenpersonen vervangen. Zoals eerder genoemd kan je denken aan banken, notarissen en incassobureaus. Maar ook communicatie platformen als Twitter, Facebook, Airbnb, Marktplaats en Uber.

Die worden nu allemaal nog geadministreerd en gecontroleerd door mensen in het betreffende bedrijf; in een Blockchain-toekomst door een autonome ‘Shared single source of truth’, dus zonder die controlerende mensen. Waardoor je onder andere volgende voordelen hebt:

  • Zeer veilig
  • Geen downtime
  • Geen censuur

Enkele alternatieven zijn zelfs al ontwikkeld op de Blockchain:

Blockchain en The Internet of things

Het internet of things zal in nabije toekomst groot worden: alles wordt aan elkaar gekoppeld via het internet.

Bron afbeelding

Al die ‘dingen’ die aan gesloten zijn op het internet kunnen ook gebruik gaan maken van de Blockchain. Bijvoorbeeld een cola automaat: deze kan dan zelf, zonder tussenpersoon, nieuwe cola bestellen. De bestelling en transactie worden geverifieerd door de miners (computers) in een Blockchain.

Ethereum

Een ander voorbeeld van een Blockchain implementatie is Ethereum: tevens een globaal netwerk van computers. Voorbeelden wat dit netwerk kan registreren en controleren:

  • Schulden
  • Leveringsbeloftes
  • Uitvoeren van een testament

In feite alle transacties waarbij leveringsafspraken worden gemaakt kunnen hier opgenomen worden met onbreekbare regels en afspraken; zonder middle man dus.

Dus geen banken

Wellicht nog wat abstract momenteel, maar de key is: de Blockchain kan alle soorten transacties controleren en registreren:

  • Autonoom
  • Gedistribueerd
  • Onbreekbaar
  • Transparant
  • Via het ‘Shared single source of truth’ principe
  • Zonder hoge kosten
  • Vele malen sneller

En kan dus banken vervangen.

Een concept: samenwerken zonder banken met OpenLucius en de Blockchain

Drupal Social intranet OpenLucius kan faciliterend zijn:

  1. Je werkt online samen in OpenLucius met klanten en leveranciers.
    Daarin worden afspraken overlegd over een levering van product of dienst.
  2. Die afspraken (en daarmee de definiëring van het te leveren product) worden vastgelegd in een ‘block’, waar tevens een afgesproken waarde (de betaling voor het product) vaststaat.
  3. Zodra het product wordt geleverd aan de klant, conform de onbreekbaar geregistreerde afspraken, dan zullen de nodes in de blockchain consensus vinden of het geleverde klopt of niet.
  4. Zo ja, dan wordt de transactie goedgekeurd.
  5. En opgenomen in de onbreekbare ketting van het publiekelijk grootboek (de ledger).
  6. De klant ontvangt zijn product conform afgesproken criteria; de leverancier zijn geld. Dit wordt tevens geregistreerd in OpenLucius.

Zie jij een bank...? Ik niet.

OpenLucius faciliteert dit gehele proces door koppelingen met de blockchain (die eindgebruikers niet eens hoeven te zien). In essentie is OpenLucius namelijk gemaakt om samen te kunnen werken met iedereen: zowel intern als extern (klanten / leveranciers).

En OpenLucius is open source (Drupal), een vereiste om te werken met de Blockchain.

Hoe dit technisch in zijn werk gaat, daar zal ik me verder in moeten verdiepen: het is momenteel een nog gedachte experiment.

Uitdagingen Blockchain en Bitcoin

De techniek gaat hard, maar is er nog niet. Er zullen jaren nodig zijn voordat grootschalige adaptatie zal plaatsvinden, vanwege onder andere deze uitdagingen:

  • Nog weinig mensen kennen -en snappen- het, het is te abstract.
  • Het is gedecentraliseerd, als het misgaat is niemand verantwoordelijk.
  • Het netwerk moet sneller worden voor een wereldwijde adaptatie.
  • Er zijn nog vele onduidelijkheden, omdat ervaring simpelweg ontbreekt.
  • Overheden zijn terughoudend.
  • Grote organisaties zullen niet zomaar al hun transacties openbaar maken. Een paradigma-shift is nodig.

Blockchain vervangt banken: video

[embedded content]

Bronnen en meer info:

Header foto: Didier Weemaels

Mar 31 2016
Mar 31

Wellicht wel eens van gehoord: ‘twee-weg authenticatie’. Als je actief bent op Facebook, Twitter of LinkedIn heb je het sowieso wel eens gezien: er is je vast wel eens gevraagd om je telefoonnummer in te geven.

In eerste instantie was ik daar huiverig voor, omdat ‘ze’ dan álles van je weten. Maar inmiddels zijn social media accounts erg belangrijk geworden; je wilt niet dat iemand relatief makkelijk jouw account hackt en je identiteit op Facebook, Twitter of LinkedIn kan aannemen.

Vandaar dat ik inmiddels mijn telefoonnummer bij alledrie heb ingevoerd. Als ik nu mijn wachtwoord wil wijzigen, zal ik dat moeten bevestigen middels een verificatiecode, die naar mijn telefoonnummer wordt gestuurd. Iemand die kwaad wil heeft jouw telefoon niet (als het goed is), waardoor de kans dat je account gehackt wordt - door het raden en vervolgens wijzigen van je wachtwoord - geminimaliseerd wordt. Deze manier van extra beveiliging heet ‘two-factor authentication’ / ‘twee weg authenticatie’.

Two-factor authentication bij bijvoorbeeld Facebook

Om als voorbeeld Facebook te nemen: als je inlogt dan is de standaard verificatie een gebruikersnaam en wachtwoord, iets wat je wéét. De tweede stap is authenticatie met iets wat je hébt, zoals een smartphone, een vingerscanner, of een bank-cardreader.

Dit hoeft niet alleen gebruikt te worden bij het wijzigen van wachtwoorden, maar kan ook als extra beveiliging bij het inloggen van bijvoorbeeld jouw social intranet gebruikt worden:

  1. Voer je gebruikersnaam en wachtwoord in
  2. Het social intranet stuur je een sms met verificatiecode
  3. Voer de verificatiecode in, in het social intranet
  4. Ingelogd

Gebruik je social intranet OpenLucius ?

OpenLucius Cloud

Neem je OpenLucius bij ons af in de Cloud? Contact ons, wij kunnen helpen met het inschakelen van twee-weg authenticatie.

OpenLucius Open Source

Heb je OpenLucius zelf gedownload en geïnstalleerd? Dan is hier een module voor beschikbaar die je kunt installeren: Two-factor Authentication- TFA. Deze module faciliteert de basis voor twee weg authenticatie in Drupal:

  • Kies welke oplossing, zoals tijd-gebaseerde eenmalige wachtwoorden.
  • Sms verificatie codes.
  • Vooraf gegenereerde codes.
  • Integratie met externe services als Authy of Duo.

Verder features van de module:

  • Pluggable: ondersteunt meerdere manieren van twee weg authenticatie en kan tegelijk werken met meerdere externe services
  • Instelbaar: ondersteunt fallback methodes en context afhankelijke uitzonderingen
  • Ondersteunt ‘flood control’ voor brute force attacks
  • goed geteste module
  • Gevoelige data voor deze authenticatie wordt versleuteld opgeslagen met behulp van de PHP extentie mcrypt.

Voorbeeld: installatie Two-factor Authentication in social intranet OpenLucius

Om te starten, installeer volgende modules in OpenLucius:

  1. Two-factor Authentication (TFA): de basis module welke alleen een API bevat
  2. TFA Basic plugins: basis TFA plugins die volgende onderdelen bevat:
  • SMS: uitserveren een verificatie sms via externe service Twilio.
  • TOTP: een “Time-based One Time Password plugin” maakt gebruik van PHP_Gansta\GoogleAuthenticator PHP library.
  • Trusted device: een plugin die ervoor zorgt dat een eenmaal ingelogde browser wordt gekenmerkt als ‘vertrouwd’. Zodat de volgende keer niet nóg een keer via de twee-weg ingelogd hoeft te worden, maar alleen één-weg: invoeren gebruikersnaam en wachtwoord.

1. Configureer de Two-factor Authentication

Ik ga in dit voorbeeld voor de TOTP, omdat die gratis is. Zoals eerder gezegd kan je ook sms verificatie inbouwen, maar dan zul je een externe betaalde service moeten aanschaffen.

Als je de module geïnstalleerd hebt, ga dan naar /admin/config/people/tfa:

  1. Schakel Twee-weg authenticatie in
  2. TOTP kies ik als de standaard. Dit is dus een variant waarbij je geen externe betaalde services hoeft te integreren.
  3. Schakel ‘recovery codes’ in als fallback.
  4. Schakel ‘Trusted Browsers’ in, als je eenmaal een keer ingelogd bent via een bepaalde browser en de twee-traps authenticatie dan kan je daarna inloggen in betreffende browser middels één-trap: gebruikersnaam en wachtwoord.
  5. Gebruikers met deze rollen zijn verplicht een twee-weg authenticatie te activeren. Ik heb alle rollen, dus iedereen ingeschakeld.

2. Activeer de twee-weg authenticatie bij een gebruiker

Installeer Google Authenticator op je smartphone

Om deze TOTP te gebruiken kan je gebruik maken van de gratis app van Google: Google Authenticator. Download en installeer die op je smartphone.

3. Configureer een nieuwe gebruiker:

  • Voeg een gebruiker toe.
  • Navigeer naar die gebruiker en klik op de tab ‘security’, klik daar op ‘set up application’. Het volgende scherm verschijnt:

  • Ga naar je Google Authenticator app en kies voor ‘scan barcode’:

  • Scan de barcode met je smartphone camera, zodat je een verificatiecode krijgt, vul die in.
  • Bij het volgende scherm ‘recovery codes’ kies voor nu even ‘skip’.
  • Je hebt je twee-weg-authenticatie ingesteld:

4. Inloggen met twee-weg authenticatie

Zodra ik met de zojuist ingesteld account inlog, dan zal er gevraagd worden om een extra verificatie code, die kan ik uitlezen van mijn smartphone:

Voer die in en that’s it! Je ziet nu dat er een twee-weg-verificatie tot stand is gekomen:

  1. Invoeren van iets wat je weet: gebruikersnaam en wachtwoord
  2. Invoeren van iets wat je hebt: een code vanaf je smartphone.

Wat dus een extra optimalisatie in beveiliging van jouw social intranet doorvoert.

Gerelateerde modules

Mar 22 2016
Mar 22

The Drupal Insert module is a convenient module to easily place images in content, without hassling around with a WYSIWYG editor. It is rightly a popular Drupal module (nearly 80,000 active installs). We are also using it in our blogs; in combination with Markdown you can easily and quickly format content.

How Insert works in a nutshell:

  1. Upload an image in an Image field, select the desired image style and click ‘Insert’.
  2. The required <img.../> tag is automatically inserted in the place of the cursor in the text.

Now you don’t need to fiddle around anymore with WYSIWYG editors that most of the time don’t do what you want anyway. Also useful is that the Insert module can scale images automatically in accordance with a defined image style in Drupal.

Quality images not optimal

The only problem is that the images are not looking good. The quality of the scaled images can be set in Drupal (Administration > Configuration > Media > Image toolkit), but I noticed they are never really good enough. Also because you have to deal with many different kinds and sizes of screens of visitors: you would like everybody to see a nice image (mobile, tablet, desktop, retina etc).

Solution for better quality images

This can be solved as follows: don't use an Image preset, but let Insert place the original image. Then make sure a css class is automatically given, which ensures the responsiveness of the image – this class is depending on the css you use. In our case this is ‘img-responsive’, since we are using the bootstrap html framework.

The Insert module setting of the relevant Image field will look like this:

(In our case it is under the link /admin/structure/types/manage/blog/fields/field_blog_images)

Directly place the original image, but make sure you upload an optimal quality/file size. A too large file is not beneficial to your Drupal SEO. First, I always resize the image in Photoshop to a maximum of 1280 px wide, as to be prepared for large and high resolution screens in future.

This will lead to an image that scales with all screens and that is nicely displayed.

Result

Look at the difference in quality of images between this blog and the Dutch translation hereof. The difference is clearly visible in the image under ‘3. Group activity stream’.

Wrap up

That’s all folks, questions or feedback? Let me know.

Credits header photo: Andrew Coelho

Mar 19 2016
Mar 19

Below you will find the module updates that catched my attention last month:

1. Security Kit

In this Drupal module a set of actions is taken against common security issues:

  • Cross site scripting
  • Cross site request forgery
  • Clickjacking

download

2. Similar by terms

Imagine, you want to show the visitors of your Drupal website a block containing relevant related content. You can do this yourself using Views - like we have done below. But this module provides this ready-made. The related content is displayed based on ‘the same terms’ and their quantity.

download

3. Content locking (anti competitor editing)

You don’t want different content managers in your Drupal website overwriting each other's changes when they are simultaneously modifying the same item. Within Drupal that is by default not possible, but in an inconvenient way: you only receive a notification when someone else has edited the content item as soon as you click 'save'. And then you have already put all your energy into your changes.

This module solves that and immediately notifies you when clicking on 'edit'.

download

4. Fast permissions administration

Drupal’s permission table is out of the box already quite big. When you are installing a number of modules, and programming some custom permissions, then it quickly becomes cluttered. This module is solving this problem: it clusters per module and provides a convenient filter function.

download

5. SideComments now

Responding to a specific piece of text in a blog, popular on Medium. And rightly so, it is convenient: immediately respond in the proper context.
The reaction is then not put under the text, but to the side of a section.

download

6. Responsive and off-canvas menu

Offer your mobile website visitors a useful navigation. One that is not in the way when you don’t need it (‘off canvas’).

download

7. Bulk Delete

Removal of many nodes at once, like more than 10,000, Drupal core does not provide this. This module is solving that problem. But take care, this module removes everything permanently; ensure backups and pay enough attention to your actions.

download

8. Search Index Wipe

The standard 'Re-index site (admin/config/search/settings) button from the Drupal Search does not empty the entire directory at once, but gradually replaces existing items with new ones.
If you run a Drupal website with lots of content and want to completely rebuild the search index, this will be difficult.
This module is solving that problem: it adds a ‘Wipe Index' button, which deletes all indexed content entirely and therefore existing content will be fully indexed again.
Mainly useful if you are executing a deploy, for example from a new version of the website.

download

9. Mail safety

If you are engaged in developing for example a Drupal social intranet, you don’t want users to (accidentally) receive test emails. This module ensures that all outgoing emails are 'captured' and collected on a dashboard.
Similar to Mail logger and Reroute email

download

10. OpenLucius News

Our module received an update. It is made compatible with the latest version of Drupal social intranet OpenLucius. Some new features have been added and bugs are fixed.

download

11. PatchInfo

In some cases you will need to apply patches for existing modules:

  • to hotfix a bug
  • to modify a feature according to your requirements

When patching, you will need to document this properly in your Drupal system. Otherwise you will overwrite your patch at the next update. You probably guessed it already: this module is helping you with that.

download

12. Chosen

Makes selecting items (for example Drupal taxonomy terms) a lot easier for content managers in your Drupal system.

download

13. Pinterest hover button

Pinterest is quickly gaining ground and you might like to capitalize on this. This simple module allows your visitors to see a 'Pin it' button as soon as they ‘hover’ over a picture. Via this button they can then add your image to their pinboards.

download

14. Range

Offers a combined field in which content managers can enter multiple numbers: a set of numbers. For example: ‘year -> to’. Specific input can be enforced, for example:

  • Minimum and maximum values
  • Precision and scale

Then you can show that set of numbers in various ways to site visitors, for example:

  • With a set division sign
  • Set prefixes and suffixes
  • Decimals and thousands: automatic commas and full stops

download

15. Retina images

Provides content managers with an additional field for each Image Upload for Retina appropriate images, high resolution images that look beautiful on a Retina display.
These retinal images are typically much larger in file size and therefore a shame to serve out, since a great deal of the screens are non-retina. A larger file means more download time and thus a relatively slower site.
Here you will find additional information.

download

16. Accelerated mobile pages (AMP)

AMP is an open source project from Google that aims for an optimal reading experience on mobile websites. It provides a front-end (HTML/CSS/JS) framework which facilitates this. This module converts Drupal pages to ‘AMP HTML’. Currently it only supports nodes, but later that will be more. There is already a Drupal 8 beta2 release, but currently they are working on a Drupal 7 release.

[embedded content]

Lullabot produced this module and wrote blogs about it.

download

Wrap up

Ok, that’s it. Next month again a Drupal modules update.

Mar 16 2016
Mar 16

Every now and then you come across a module you wished you saw before. And I wonder why we did not discover this one earlier: WYSIWYG Filter. It even exists since Drupal 6.

WYSIWYG Filter is solving the following problem:

After installing the Wysiwyg module – and when you are using for example TinyMCE as editor – desired buttons can be configured under /admin/config/content/wysiwyg/profile/

This will offer you a text editor and will avoid content managers having to write HTML code:

(Screenshot from Drupal intranet OpenLucius)

To make sure this HTML is shown in the frontend (for visitors) you will need to allow these elements. This can be set under ‘text formats’ (/admin/config/content/formats). In a default Drupal installation it is needed to enable the following filter (to protect your Drupal against unsafe and unwanted html/js): ‘Limit allowed HTML tags’. Then you will need to specify the allowed elements:

The problem now is that everything will be stripped, except what is standing here. So also the required HTML attributes and properties. Like for example inline styles to line out text and apply colour, but also required id’s and classes. After installation of the module this problem will be solved, as it is offering the right configuration tools and therefore allowing elements, attributes and properties required by you for Drupal site visitors:

A detailed screenshot can be found here and is also showing that whitelists can be added for required allowed:

  • classes
  • element id’s
  • URL’s with inline styles
  • domains

The module can also, for example, automatically place rel="nofollow" based on your settings. This way the content flow will be build in a comprehensive manner for search engines which is great for your Drupal SEO.

Integrated default safety

HTML attributes related to the DOM events (on*) are not permitted for safety reasons (e.g. to prevent XSS). Also, the following elements are not allowed for safety reasons: applet, area, base, basefont, body, button, embed, form, frame, frameset, head, html, iframe, input, isindex, label, link, map, meta, noframes, noscript, object, optgroup, option, param, script, select, style, textarea, title.

Wrap up

De module is included in the Drupal 8 core, but since Drupal 7 will stay around a little while longer it seemed a good idea to share some knowledge about this Drupal module. Questions or feedback? Let me know!

Header photo credit: Karl Fredrickson

Mar 08 2016
Mar 08

We hebben zojuist een update doorgevoerd van social intranet OpenLucius (een Drupal distributie). Hierbij een opsomming van de nieuwe functies:

1. Document management vernieuwd

We hebben het beheren van bestanden geheel vernieuwd. Het is nu sneller en meer bruikbaar: het werkt nu soortgelijk aan Apple's Finder en Windows Verkenner, waardoor alles tevens meer herkenbaar is. Zie deze video (vanaf ~ 1:24)

[embedded content]

2. Login automatisch via App

Je kunt OpenLucius toevoegen aan het startscherm van je smartphone, zodat je het als App kunt gebruiken. Als je deze 'bookmark' maakt via de nieuwe 'Gebruik als App' functie, dan zul je voortaan automatisch ingelogd worden zodra je OpenLucius als App vanaf je smartphone start.

1. Klik op 'Gebruik als App' op je gebruikers dashboard:

2. 'Voeg toe aan home' op je smartphone:

3. Ordenen Todo-lijsten

Je kunt nu Todo-lijsten handmatig rangschikken:

  1. Ga naar de tab "Todo's" in een Groep
  2. Klik op 'Orden Todo-Lijsten'
  3. Versleep de Todo-lijsten in gewenste volgorde

4. 'New' icoon naast groepen op homepage

Als een Groep nieuwe content heeft voor je, dan zal dit icoon erbij staan:

5. Verstuur notificaties van een nieuwe Todo direct vanaf het dashboard

6. 'Lees meer' in nieuws tab op homepage

De tekst wordt nu automatisch ingekort en er wordt een 'Lees meer' link bijgeplaatst. Op deze manier blijft het overzicht compacter en beter leesbaar.

Feb 16 2016
Feb 16

Let’s get straight to the point:

1. Infinite scroll

On many websites we are currently seeing ‘infinite scroll’ instead of page numbers. For sure you know how it works: at the bottom of a list with items (f.e. an activity stream) 20 new items are automatically loaded.

This module implements a ‘jQuery auto-pager plugin’ that provides the above functionality. It is possible to configure:

  • on which page it is active;
  • a ‘load more’ button or automatically loading new items.

Infinite scroll
Drupal 7

2. OpenLucius Inline Images

This module provides Drupal distribution OpenLucius to add images to text.
The image is well protected as well: only users in the relevant (work)group can view images and directly request them via url – users that are not a member of the group cannot.

The Drupal Grants system is respected, something that all other ‘image managers’ are lacking; that’s why we decided to ‘scratch our own itch.

OpenLucius inline images
Drupal 7

3. Simple social icons

Social icons are omnipresent on webpages. It is a direct integral connection to your online presence. This module provides an easy way to place the icons and display personal colors. Furthermore, this module implements 2 blocks:

  1. ‘Share’ (parts) of a page.
  2. ‘Follow’ for example your Twitter account or Facebook page.

Social icons
Drupal 8 alpha

4. Secure Login

Safely sending data over the internet will be standard in the near future. Search engines like Google will probably better evaluate protected websites.

This module facilitates sending and receiving encrypted data via https. For example, data from forms and passwords. It also forces safely sending cookies to prevent session hijacking.

Secure Login
Drupal 7 & Drupal 8

5.Watcher

If you want to be informed about changes in an article or the posted comments, then this module can help. It makes sure that visitors of your Drupal website can ‘watch’ (follow) nodes and comments, also without posting a comment themselves. Some features:

  • Email notifications can be set per node.
  • Usable for both anonymous and registered visitors.
  • Configurable email templates.
  • Visitors can receive an overview of everything they are ‘watching’ (following).

Watcher
Drupal 7

6. Colorbox (Drupal 8 release)

Colorbox is a jQuery plugin, mainly used to display images in a pop-up slideshow. This module implements Colorbox in Drupal and has been popular since Drupal 6; the Drupal 8 version has been released yesterday.

Colorbox
Drupal 7 & Drupal 8

7. Markdown (Drupal 8 Release)

Markdown, for me an indispensible tool when writing content. You don’t want to fiddle around with a WYSIWYG editor but you do want to format text quickly and easy? Markdown. Now also available in Drupal 8. Nice!

Markdown
Drupal 7 & Drupal 8

8. Isotope (with Masonry)

‘Filter & sort magical layouts’ is the tagline of Isotope, a javascript library which is beautifully aligning blocks on your webpages, on every device and screen.

This module can be integrated with Drupal Views, so you can align simple selections of content by Isotope – without having to integrate the javascript in your Drupal system. But Views is not necessary, you can also use it in your own theme features.

Isotope
Drupal 7

9. Toolbar Menu

Some admin pages are visited often and you want to reach at once. This module helps configure which items are displayed in the main menu.

Toolbar menu
Drupal 8

10. Focal Point

Drupal can automatically crop images so they are always beautifully aligned for your visitors. But it can happen that Drupal cuts important pieces of an image.

This module provides a solution for this: you select a ‘focal point’ in the image so Drupal knows the key point in the image. When the image is automatically cropped this point will be considered key and will not be cut out.

Focal point
Drupal 7 & Drupal 8 dev

11. Node-level Blocks

By default it is possible to place a Drupal block on certain pages based on content type or specific paths and nodes. But you can always select just one region (position) on the page (f.e. left sidebar). This module allows you to determine per node in which region the block should be placed.

Also see this blog by Deeson

Node level blocks
Drupal 7

12. Simple hierarchical select

If you have a lot of vocabularies and terms that are hierarchically (nested) structured then it can sometimes be a challenge to find the right one when adding content. This module solves this problem by displaying the hierarchy in various drop down boxes so you can find the right term more quickly.

Simple hierarchical select
Drupal 7 & Drupal 8 alpha

13. Computed Field

Provides a field (Drupal Field) where you can define certain logics (via PHP) such as calculations on users/node data or values from other imported fields. You can find some code snippets here as an example.

Note that this code will be placed in the database, and not in GIT. Bugtracking is therefore also more difficult and ‘Pareviewing’ of the code is not taken into account. This module is not recommended when you are working in a team of developers on a Drupal System.

Computed Field
Drupal 7 & Drupal 8

14. Custom Publishing Options

Sometimes you are in need of additional ‘publishing options’ with a node, like ‘archive’ or ‘featured’. Through this module they can be configured and used in Views.

Custom Publishing Options
Drupal 7

15. Override Node Options

In some cases you want content managers to only enter a title and description, but not ‘author’, ‘revisions’ or for example ‘sticky’. In default Drupal you have the choice between everything and nothing. But with this module you can set more detailed permissions per field, so that certain roles have limited rights to modify node fields.

Override Node Options
Drupal 7 & Drupal 8

16. Disqus

Commenting platform that can be integrated on every website and with lots of added value compared to the default Drupal response system, read here more why. This module is easy to install and integrates Disqus in your Drupal system.

Disqus
Drupal 7 & Drupal 8

17. Publication Date

Drupal nodes have by default a ‘created’ and ‘changed’ date, but no ‘published’ date. Sometimes this can come in handy.

Publication Date
Drupal 7

18. Restrict password change

Within Drupal core users can be given rights to add other users, but then they can also automatically change the passwords of everybody. If you don’t want that, then install this module to add a new permission 'change other users password'.

Restrict password change
Drupal 7 & Drupal 8

19. User Expire

Do you want to give a user temporarily access to your Drupal system, for example a client in your social intranet or a temporary content manager? This module helps creating temporary access and ensures a user is automatically blocked after a certain time. This way you cannot forget it and data will not accidentally leak.

User Expire
Drupal 7

20. Custom Search

Do you like to give your Drupal visitors more options when searching than just one search box? This module provides a solution for this by searching in desired content types or a specific module. You can also configure the type of field instead of just a free text field.

Custom search
Drupal 7 & Drupal 8

21. Cache Flush

Drupal has standard limited configuration options to empty the cache. This module provides a solution for this. It claims to be the ‘ultimate tool’ to empty caches within Drupal. It is possible to make a number of presets to set all the requirements related to caches for different servers. Usable with all roles and since version 3 it is also supporting Memcache and Varnish.

Cache Flush
Drupal 7 & drupal 8

22. Relative Path to Absolute URLs

Provides a filter that generates absolute url’s from relative url’s; so relevant images are also becoming visible in for example newsletters, Drupal planet and other external systems.

Relative Path to Absolute URLs
Drupal 7 & drupal 8

23. Flush Facebook Cache

I have encountered this more often: after writing a blog and posting it on Facebook, I wanted to change a text or image. But once Facebook has indexed your page, it is placed in the cache. The next time you are posting the url of your page on Facebook, it shows an outdated image. This module provides a solution for that.

Flush Facebook Cache
Drupal 7

24. Bootstrap Library (Drupal 8 release)

Release for Drupal 8 of the popular HTML framework Bootstrap – our favourite.
Bootstrap Library

Bootstrap Library

25. Views Autocomplete Filters

In Views you can set up filters through which visitors of your Drupal system can filter (search) a.o. with free text fields within a View (f.e. a list with content). This makes the search easier by adding an ‘auto complete’. So as soon as the visitor starts to type, this module will complement the entry with suggestions. See also this tutorial:

[embedded content]

Views Autocomplete Filters

Wrap up

Ok, that’s it for this month. Questions or feedback? Let me know. Next month again a cool modules update, so stay tuned!

Feb 10 2016
Feb 10

Search engine optimization (SEO) has always been important, but in recent years its importance seems to have increased significantly. We were more often dealing with Drupal SEO implementations than in previous years. Many of the implementations contained overlapping components. Below we will discuss the most important ones:

1. Speed

Google Page Speed is a good indicator of how speed is experienced by end users and therefore by Google. Google attaches great importance to speed because end users are simply doing the same.

An example of a test of the front page of this site:

As you can see we can further optimize mobile and desktop by following the instructions provided. Although on our Dutch blog we have a Node.js frontend (and a headless Drupal 8 backend) a Drupal frontend can be tested as well with the Google Page Speed tool. The tool is testing, among others, the following:

  • JS and CSS aggregation and minimize (minify)
  • GZIP / browser caching
  • Optimized images
  • Landing page redirects
  • Prioritize visible content
  • User experience issues, for example the use of non generic plug-ins.

2. Schema.org

Schema.org is a collaboration between Google, Yahoo! and Bing to standardize the way data is structured in web pages. By using these standards these search engines are ‘snapping’ the content of your web page better, resulting in a significant SEO boost.

The schema.org library contains descriptive tags for content like films, persons, organizations, events, locations, etc. The purpose of the search engine is to make search results more clear, allowing people to easily find the right web pages.

3. Mobile compatible / responsiveness

2015 brought us mobilegeddon: if your website is not mobile ready then Google will appoint you penalties resulting in a lower ranking. And rightly so, a large part of the website visitors are using internet on their mobiles; and you would like to give them a good experience. You can test here if your website is mobile compatible.

4. Google Webmaster Tools / Search console

Essential SEO tool, sign in here and register your website. Then it is important to upload a XML sitemap. The Drupal module XML sitemap will help you with this. Once you have done that, you will be able to see how your website is ranking in the organic results of Google:

  • Which keywords enable your pages to be found in the search results.
  • What are people really clicking so that they land on your website.
  • Errors on your website.
  • Links that are not correct.
  • Links that are not accessible.
  • Schema.org implementation: how is Google treating the enriched html pages.

See below for example the dashboard of this website, with links unfolded and all the insights you can find here:

5. Write good, long content

Apparently Google is rating your Drupal website higher when you are publishing long and good quality content. Long and good pieces of content are also adding to the acquisition of new clients:

  • You have something valuable to promote on social media.
  • You have an excuse to reach out to your potential customers.
  • Visitors are staying longer on your website.
  • You are creating authority.

Read here more details about the how and why.

Areas of importance when writing content

  • Backlinks, make sure you get links on other websites that are highly rated.
  • Limit the number of relevant internal and external links, so that Google (and the - visitor) can better understand the context of your article.
  • Analyze the (successful) competitors: discover where they are, what they link and how they dominate social media.
  • Make sure your blog website is coherent, not a website with islands where non-cohesive content is separated from one another.
  • Update regularly: check for example once every month your articles and improve where appropriate: cohesiveness, spelling mistakes, new insights, etc.
  • Allow visitors to place comments using Disquss that has become a social media platform where you can attract inbound links.

Useful Drupal SEO modules

6. Page title

By default Drupal has one field to enter the title of an article. This title is used for both the page title as the ‘html title’:

The html title is important for SEO; usually you would like to define it differently than the readable title of the article (as the visitor is viewing it). This module is solving this problem and allows you to manage two titles individually.

You can also give the HTML title a particular predefined format so that it is created depending on the content type. For example “Blog Lucius | 18 Drupal SEO modules and tools for better findability in Google”. Where ‘Blog Lucius’ is always automatically stated in the beginning of the title with a pipe (‘|’) in between.

Download and more info on Page Title - (Drupal 7 - Drupal 8 info)

7. Metatags

Years ago meta keywords were one of the most important elements used to be found. But not anymore, Google is finding your Drupal site mainly with content and links to your pages. The meta keywords are still important but mainly for:

Indicating snippets
The (summary) text about your page that will appear in the search engine:

Open Graph implementation
Rapidly emerging technology, important for previewing your page on social media and now also in for example Gmail:

Download and more info on Metatag - (Drupal 7 & Drupal 8)

8. Pathauto & Subpathauto

Pathauto is a widely used Drupal module: it converts standard Drupal (/node/123) links to readable links (/news/this-is-a-news-item). Useful for your visitors and thus for Google.

Download and more info on Pathauto - (Drupal 7 & Drupal 8 dev)

Subpathauto is an extension of Pathauto: it recognizes sub-paths and automatically generates associated paths.

Download and more info on Sub-Pathauto - (Drupal 7)

9. Pathauto persistent state

The popular Drupal module Pathauto is useful for automatically creating nice URL’s. It is also possible to exclude particular content from an ‘automatic alias’ and then manually enter the URL.

Pathauto sometimes ‘forgets’ that the URL of certain articles was manually set, and creates them again automatically. As a result the URL of your page could change without you realizing it, not handy..

This Drupal module is solving this problem: it makes sure that Pathauto remembers for which articles you have turned off ‘automatic alias’.

Download and more info on Pathauto persistent state

10. Global redirect

Avoid duplicate content. Ensures for example that 'node/123' is no longer available, but only the search engine friendly URL. It also checks if clean URL’s are enabled and checks whether visitors have access before performing a redirect.

Download and more info on Global Redirect - (Drupal 7 - Drupal 8)

11. Redirect

It can happen that the title of an article needs to be changed, usually the URL is changing then as well. This module creates a 301 - Permanent redirect so that the users from an old URL are automatically redirected to the new path. This way Google also knows that the new URL needs to be indexed and that the old one can be removed.

Download and more info on Redirect - (Drupal 7 - Drupal 8 info)

12. XML sitemap

Necessary for an insight into your Drupal pages in Google's Search console, see ‘Google Webmaster Tools / Search console’ above for more information.

Download and more info on XML sitemap (Drupal 7, Drupal 8 info).

13. HTML Purifier

Can clean the HTML of content so that it continues to comply with the W3C standards.

Download and more info on HTML Purifier - (Drupal 7, Drupal 8 info ).

14. Search 404

A standard 404 page (‘page not found’) is providing rather brief information for your visitor. This popular module is changing this: it does not show a static page, but will search in your Drupal system and will show visitors results of pages they might have been searching for.
This feature will also have a positive influence on the SEO of your Drupal system.

Download and more info on Search 404 (Drupal 7 & Drupal 8)

15. Site verify

Useful mini module to verify your site in Google’s webmaster tools.

Download and more info on Site verify - (Drupal 7, Drupal 8 info).

16. Link checker

Analyse your content and detect dead links, important to fix them for your visitors and thus for Google.

Download and more info on Link checker - (Drupal 7, Drupal 8 info).

17. Taxonomy Title

Similar to the previously mentioned ‘Page title’, using this module you can among others change the (html) page title per term / tag.

Download and more info on Taxonomy Title - (Drupal 7)

18. Menu attributes

Add html elements to menu links: id, name, class, style and rel. This allows you to add among others ‘rel=nofollow’ to design the flow of links in your website better.

Download and more info on Menu attributes - (Drupal 7, Drupal 8 info).

Wrap up

Ok, enough SEO for now, hopefully you are not immediately conquering our ranking in Google ;-) Questions or feedback let me know in the comments or via @joris_lucius.

Jan 26 2016
Jan 26

Dutch translation

Lately I have been hearing a lot about Laravel. This is a PHP framework to build web applications and that is quickly gaining popularity. I wanted to test it to keep up to date with this current technology. So I thought: I will build a concept in Laravel to see how it works and to compare it with Drupal 8.

My goals:

  • A static page in which the content is loaded from a local database.
  • Build a list of Blog items which is fed from a Drupal 8 RESTful API (which I had previously built for Node.js).

Overall content of this blog:

  1. Introduction to Laravel
  2. Laravel’s foundation
  3. Installing Laravel
  4. Routing in Laravel
  5. Laravel’s Migration: management of the database structure
  6. Eloquent ORM: query the database
  7. HTML templating in Laravel: Blade and Views
  8. Loading data from a RESTful Drupal 8 API

1. Introduction to Laravel

Required tools and knowledge

In order to participate you will need to have the following basic knowledge and tools:

  • PHP: intermediate knowledge
  • HTML/CSS basic knowledge
  • Good code editor (IDE), I am using PHPStorm
  • A browser, f.e. Firefox

What is Laravel

  • A PHP framework for web applications
  • Developed by Taylor Otwell
  • First release: February 2012
  • Open Source (MIT licence)

Why Laravel

According to the developers it is a 'clean, modern web application framework’, which is built on other great tools. In addition, it is said that Laravel is ‘fun to code’.

Laravel is a MVC Framework

  • MVC = Model View Controller, a modern structure of web applications.
  • Model: application data and functionalities
  • View: the visible output, the HTML
  • Controller: interaction between user, model and view. Facilitated in Laravel by PHP.

Standard tools in Laravel

  • Routing of incoming requests
  • HTML templating (Blade)
  • Database definition and version control (Laravel’s Migrations and Eloquent ORM)
  • Authentication: login users and manage permissions.
  • Emailing with attachments

Laravel core is not a cms like Drupal 8

Laravel out of the box is not a cms. There is a cms component available (October cms), but in this regard Laravel cannot be compared with Drupal 8, which does offer in the core full blown cms functionalities. If you want to compare Laravel with Drupal, you will need to do this on the level of Drupal API and not Drupal cms.

2. Laravel’s foundation

Laravel’s foundation is built on strong components:

  1. Symfony for core Laravel functionalities: including simulation, access to files and debugging. Drupal 8 is also using Symfony components.
  2. Composer: a dependency manager where hundreds of packages are already available. (similar to NPM for Node.js). Composer can also be used in Drupal 8, but not to the extent of Laravel: Drupal 8 is using modules with YAML files for this.
  3. Eloquent ORM (Object Relational Mapper): object oriented database management. Similar to the Database abstraction layer in Drupal 8
  4. Migrations: database version control for Laravel. This is similar to the schema API in Drupal 8 and Migrations from Ruby on Rail Migrations.
  5. Blade: html templating system, Drupal 8 uses Twig.

Laravel is a framework built on several other strong frameworks. Below an explanation of each component:

2.1 Laravel’s foundation: Symfony

Symfony is one of the main components in Laravel. The following Symfony components are, among others, used in Laravel:

Future releases of Laravel
Laravel has announced to stay in sync with future releases of Symfony.

Symfony users
When you are a user of Symfony you can also use Laravel components.

2.2 Laravel’s foundation: Composer

Laravel uses Composer, a PHP dependency manager. The main features are:

  • Works on a ‘per project’ basis, not global.
  • Works on Mac, Windows and Unix.
  • The dependencies are defined in a JSON file: composer.json. Composer can also be used in Drupal 8. This approach is also similar to the package.json in Node.js where NPM is ‘acting’ as Composer, see also.
  • See Packagist.org for 3rd party packages that can be used in Laravel by installing them through Composer.

2.3 Laravel’s foundation: Eloquent ORM

Eloquent ORM is Laravel’s database component, similar to the Database abstraction layer in Drupal 8. ORM is an acronym for Object Relational Mapper. It has been developed for Laravel, but can also be used outside Laraval. It is using an Active record pattern for database CRUD actions. It can facilitate one-on-one, one-on-many and many-on-many relations.

2.4 Laravel’s foundation: Migrations

Tables can be created, structured and (version) controlled through Laravel’s Migrations. All this is done via code, not configuration.

2.5 Laravel’s foundation: Blade

Blade is Laravel’s html templating machine. A Blade file is saved with the extension ‘.blade.php’. Variables in the template file can be placed as follows: {{variable}} (XSS filtered) or {!! variable !!} (unfiltered, [!] only use this when you know exactly what you are doing). You can also use PHP functionalities and codes in blade files. Blade also supports subtheming and conditional controls.?

3. Installing Laravel

I am working on a Mac with OS X El Capitan. The current Laravel version is 5.1, and that is the version I am going to use. Go to Laravel docs and follow the instructions:

  • Make sure you have installed Composer.
  • Make sure the directory ~/.composer/vendor/bin is in your PATH, so that the laravel command is everywhere available. Learn here how.
  • Now you can install via the command laravel new a fresh Laravel installation. I am now going to my webroot and enter laravel new blog concept: a fresh Laravel installation will be created in the folder /blogconcept:

The created install:

  • You will get an ‘application key’. This will be used, among other things, to encrypt data, such as session data.
  • Go to the Laravel installation and run this command: php artisan serve to activate the Laravel server. Artisan is Laravel’s command line environment.

Go to your browser and navigate to http://localhost:8000. You should be seeing this:

4. Routing in Laravel

Routes are used to facilitate incoming page requests. This is similar to Drupal 7’s hook_menu() and Drupal 8’s routing system. The routes can be found in /app/Http/routes.php:

Static routes
In routes.php you will see the default homepage defined, which you saw above in the browser. Here you can add your own routes. Below an example of a page with static information:

In a browser:

Dynamic routes
Routes can also be built dynamically through working with variables:

Note the double quotes that are required to dynamically print out the variable. If you are using single quotes, Laravel will print literally {$person}.

In the browser:

5. Laravel’s Migrations: management of the database structure

First you will need a database, the standard used here is MySQL; I will make a database called ‘blog concept’. All the database settings are in config/database.php:

In this file you can set:

  • Fetch style
  • Type database: mysql is the standard, but Laravel also supports sqlite, pgsql and sql server.
  • The database connections, I am entering the following:

Tables can be managed manually through for example phpmyadmin, but that is not advisable. In Laravel the structure of tables/database can be programmed in code, resulting in flexibility and version control. ‘Database structure’ is also called ‘schema’.

By managing this in Laravel’s Migration developers can easily keep their databases in sync within a version control system, such as GIT. So you can also easily revert a database change.

Example: I am creating the initial migration file through command php artisan make:migration create_content_table. In the created file I am adding code that defines database tables:

This migration class exists of two methods: up and down. Up is used to create new tables, down is used to make the Up actions undone.

Execute command php artisan migrate, that will apply the migration code, and voila: the database tables are created:

More information: http://laravel.com/docs/5.1/migrations

6. Query the database with Eloquent ORM

For now I have manually filled the newly created tables with test content. Below a simple example to query this data:

  • Create a Model: php artisan make:model Content
  • Laravel creates the model in the /app folder:

  • The model is called ‘Content’ and not ‘Contents’, Laravel is smart enough to make that connection by itself.
  • Add the following code in routes.php:

$content = App\Content::find(1) => This is all it takes to query record with id=1 from the database table 'Contents', also here Laravel is smart enough to make the link with ‘Contents’. Then, all the fields from that record are stored in object $content, which can be assigned as variables to a blade template.

More information: http://laravel.com/docs/5.1/eloquent#defining-models

7. HTML templating in Laravel: Views & Blade

As previously indicated the HTML templating engine Blade is used in Laravel. The HTML files are called views, something else than Drupal Views: these are lists. An example of the use hereof can be seen immediately in the standard installation. In routes.php on line 15 the Laravel view ‘welcome’ is invoked: return view(‘welcome’);.

The views are included in the folder /resources/views, there you can also find the standard view ‘welcome.blade.php’:

An own dynamic view

Blade facilitates dynamically filling HTML pages. An example: I am creating a new view file called ‘about.blade.php’ and copy the HTML from welcome.blade.php:

I am adding the following code in routes.php:

You can see that the ‘about’ view is evoked through View::make() with an additional array included in which variables with content are defined that were previously loaded from the database.

Then I can use those variables in the Blade template:

In the browser:

FYI: more about Blade templates.

8. Data from a RESTful Drupal 8 API

As an example I am using the Drupal 8 API that I built earlier. The json output is looking like this:

First I played a bit around with Composer packages Buzz & Guzzle, both http clients. Those packages are facilitating much more than just retrieving data from a REStful API: POST requests, streaming large uploads, streaming large downloads, using HTTP cookies, uploading from JSON data, etc...

That is too much overhead, for now I can work with a standard php functionality: file_get_contents en json_decode:

  1. Create a new route: /blogs
  2. Query the json data from the external Drupal 8 RESTful API.
  3. Run through the json arrays data and create a new array where: key = url, value = blog title
  4. Render the Blade html view ‘blogs’.

Then I am copying an existing blade view and rename it to ‘blogs.blade.php’:

In this blade html view I am running through the associative array and am creating in this way a list with links:

Creating the detail page of a blog

Finally I would like to accomplish that when I click a link, the detail page of that blog appears:

  1. Create a new route with a variable
  2. Request the data from the Drupal 8 RESTful API.
  3. Look for a match in the url variable and a url in the json array from the API.
  4. When a match is found, create the variable: the title and body from the matched item.
  5. Render the html through a blade view.

In a browser:

As you can see, a lot still needs to be done concerning the styling. But as a purely functional concept, I am leaving it now the way it is.

Wrap up

Ok, that’s it for now. This is only an introduction in which I produced a concept. Many advanced components of Laravel have not yet been discussed, such as incorporating the logic code /routes.php that I placed to Models and Controllers. I would like to discuss this further in a next blog. Questions or feedback, let me know!

-- Cheers, Joris

Jan 21 2016
Jan 21

The holidays are over for a while now, so it's about time for a new blog. In this article I'll discuss 12 modules that can help you get started with a great Drupal site:

1. Max image size

A default Drupal installation can check if an uploaded image is too large and display a warning. This module does something similar but is also checking previously uploaded images that are too large and likely taking up too much space.
It scans all the images (also already uploaded ones) and reduces the size of the original

More info and download - Drupal 7

2. User Import

Useful module to import users using a CSV file.

More info and download - Drupal 7

3. Select (or other)

Drupal’s form API knows by default a select element that allows you to offer choices to those who enter content. This element is limited to the provision of predefined terms (categories). After installing this module, this element can be expanded with an additional field: let the end user choose ‘other' and offer a free selection field.

More info and download - Drupal 7 & Drupal 8 Alpha

4. Captcha-free Form Protection

Everybody wants to be protected against spammers, this is often done through the Captcha technology; probably you have heard of this before. This module protects you against spammers without Captcha, since this is often a barrier for visitors.

The module applies other techniques (‘behind the scenes’) such as checks if cookies / javascript are disabled, it can also check whether a certain time has exceeded. On the basis of these data it can determine whether the person who sent a form is most likely a spammer or not. The Honeypot module contains similar end features.

More info and download - Drupal 7 and Drupal 8

5. Twitter block

Simple but common used module: shows a Twitter stream from a particular account.

More info and download - Drupal 7 and Drupal 8

6. Leaflet

Leaflet is a javascript library that is quickly becoming popular and that let’s you create maps. It is an alternative to Google maps, allowing you to easily create customized maps and integrate external map services (for example Mapbox, Stamen or Thunderforest). Easy to configure, mobile-friendly to navigate and light in code.

For a detailed introduction see Drupalize.me.

More info and download - Drupal 7 & Drupal 8 dev

7. Better watchdog UI

The Drupal core has a logging module which gives great insights in errors, notices, content and user actions, etc. Install this module if you want to filter better in this log.
FYI: Till Drupal 5 Drupal’s logging module was called ‘watchdog’, this term is still used for logging elements.

More info and download - Drupal 7

8. Check for acknowledgement

In some cases you want to know whether users of your system have read a particular piece of content. This is now possible after installing this module: it places a check mark at the bottom of a content page. Users placing the check mark are logged which is visible to you as a site administrator. This allows you to see who really confirmed they read the article.

More info and download - Drupal 7

9. IP address manager

Log the IP addresses of users logging into your Drupal site. This can be used for many things:

  • Detecting suspicious logins;
  • Identifying misconduct;
  • Detecting duplicate accounts.

More info and download - Drupal 7

10. Taxonomy container

Make the choice easier for content managers by clustering terms better.

More info and download - Drupal 7 & Drupal 8 beta

11. Date Facets

A widget for when you are using the Facet API: generates an additional block in which date-based filtering options are offered.

More info and download - Drupal 7

12. Read only mode

When putting your system in the maintenance mode in a default Drupal installation, the entire system will be temporarily put offline; the visitors will receive a maintenance message. Usually you would prefer that nobody is logged in on your site, as content can be changed during the update process. Those changes could be lost.

If you can ensure that nobody can enter/change content during maintenance, then you are also adequately covered - provided that your update is not generating errors. This module is doing just that: it places your site in the maintenance mode, so visitors can still view the site but cannot enter/change content.

More info and download - Drupal 7 & Drupal 8 beta

Wrap up

And finally, I discovered this cool site: modulecharts.org . Next month again a module update, so stay tuned! Questions or feedback? Let me know in the comments below.

Jan 18 2016
Jan 18

In 2016 vervolgen we onze reis in continue verbetering van OpenLucius. Hieronder alle verbeteringen en nieuwe functies van deze maand.

Deze wijzigingen zijn reeds doorgevoerd voor alle klanten in onze cloud. Draai je de open source versie? Download en installeer dan de laatste release.

1. Afbeeldingen in tekst

Vanaf de eerste release van OpenLucius hoorden we deze wens vaak voorbij komen, hoog tijd dus om deze in vervulling te laten gaan. Uiteraard zijn je afbeeldingen veilig, je kunt ook deze alleen bekijken als je toegang hebt tot de groep waar ze in geplaatst zijn.

Draai je de open source versie?
Download en installeer dan de module OpenLucius Inline Images.

2. Wie plaatste een 'Like'

Je kunt nu zien welke mensen een Like geplaatst hebben bij een item. In voorgaand versie kon je alleen zien hoevéel mensen een like plaatste.

3. Groep activiteiten stroom

Je kunt nu per groep bekijken wat er gebeurd is, middels de groep specifieke activiteit.

4. Groep opties in drop down

  1. In voorgaande versies stonden deze functies geheel onderaan het groepsdashboard, ze zijn nu meer bruikbaar geplaatst; waar je deze zou verwachten.

5. Gebruiker activiteiten stroom

6. Gebruikers dashboard is nu opgedeeld in tabs


1. Interactieve tabs, in vorige versies stond alle deze informatie op één (te) groot gebruikers-dashboard.

7. Grote 'Opslaan' button in rechter zijbalk


Deze button staat bij het toevoegen en wijzigen van items in de rechter zijbalk. In vorige versies stond deze alleen geheel onderin het scherm. Je hoeft nu dus niet meer geheel naar beneden te scrollen om een item op te slaan.

8. Timetracker, budget in rechter zijbalk


Als je gebruik maakt van de timetracker, dan kan je nu het budget van een todo zien in de rechter zijbalk.

9. Check-ter-sluiten-todo nu ook op dashboard van een gebruiker


1. Wanneer je hier een vinkje plaatst, dan zal de todo gesloten worden, net als op het groepsdashboard.

10. Notificatie van nieuwe gebruikers (optioneel)

Als een nieuwe gebruiker wordt toegevoegd, dan kan OpenLucius nu (optioneel) een notificatie sturen naar mensen met de rol 'admin'. Zo kan je centraal in de gaten houden of de juiste mensen worden toegevoegd. Je kunt dit zelf instellen, lees meer.

11. Melding als er nog geen todo-lijst is aangemaakt.


Als je een todo toevoegt in een groep zonder todo-lijst, dan krijg je een melding en kan je direct makkelijk eerst een todo-lijst aanmaken.

12. Alle extra plugin modules bijgewerkt

We hebben alle extra OpenLucius 'add on' modules bijgewerkt waar nodig:

13. Divers

Dec 23 2015
Dec 23

Our year-end rush is in full swing. Briefly looking back, we have had a good year! For the last time this year, the module updates, and what struck me:

1. Block Refresh

A block in Drupal will not change its content by itself. Perhaps you would like a block to refresh automatically: so that visitors of your Drupal website will get to see for example every 15 seconds a new article, or an urgent message coming through without people having to refresh their page.

After installing this module you can set this per block in three different ways:

  • Automatically via a timer (f.e. every 15 seconds).
  • Manually with the aid of a ‘refresh link’.
  • Once per ‘page load’.

Even when you have enabled Drupal’s block cache this module can make sure you will get to see new content.

(Drupal 7)
https://www.drupal.org/project/block_refresh

2. Simplify

If you look at a standard Drupal form to add, for example, a new page, it looks a bit messy. There is a lot of information on the screen, which is redundant for content managers. This commonly used module cleans up that junk.

(Drupal 7 & Drupal 8)
https://www.drupal.org/project/simplify
??

3. W3C Validator

A W3C validated web page means that the HTML formatting is correct according to the standards. This means that the structure is sound and that probably all browsers and screen readers can properly read the page; this is also good for your SEO. This module helps you with W3C validations:

  • It validates new pages or nodes you are creating.
  • It can generate a report of all your pages.

(Drupal 7 & Drupal 8)
https://www.drupal.org/project/w3c_validator

4. Search 404

A standard 404 page (‘page not found') gives rather poor information to your visitors. This popular module will change that: it does not show a static page, but will search into your Drupal system and will show your visitors results of pages they might have been looking for.

This feature will also have a positive impact on the SEO of your Drupal system.

(Drupal 7 & Drupal 8 alpha)
https://www.drupal.org/project/search404

5. Custom Search

The default search field in Drupal is pretty straight forward: a search box and a ‘search’ button. This module expands this with more advanced search options:

Configure text:

And some config options:

There are more advanced options, install the module and see which ones are of interest to you.

FYI: The Drupal 8 version gave me an error during the installation in Drupal 8.0.1

(Drupal 7 & Drupal 8 beta)
https://www.drupal.org/project/custom_search

6. Block by date

Let’s assume you want to place a notification at a given time within a block in your Drupal site. For example, an offer, notification or maintenance message. Then this module can come in handy: it can automatically switch a block between a specific date and time on and off for you.

(Drupal 7)
https://www.drupal.org/project/block_date
????

7. Scheduled maintenance

It is preferred to announce a scheduled maintenance on a website. So users know that the site - or part of it – is temporarily unavailable. Within the Drupal core functionality it is possible to enable the ‘maintenance module’ for your website, but it is only possible to turn it off or on.

With this module you can automatically inform your website visitors (or social intranet) about a scheduled maintenance:

  • You can set a message with the announcement.
  • Specify how long up front this message needs to be visible.
  • Specify when Drupal should actually go into the maintenance mode.

(Drupal 7 & Drupal 8 alpha)
https://www.drupal.org/project/scheduled_maintenance

8. Select2 Field Widget

A better and more useful way to enable your content managers to make a selection.

(Drupal 7)
https://www.drupal.org/project/select2widget

9. Back to top

Very popular since the rise of responsive Drupal websites: the ‘back to top’ button. Convenient for visitors with a mobile or tablet.

(Drupal 7 & Drupal 8 beta)
https://www.drupal.org/project/back_to_top

10. Form Bloc IP - FBIp (Drupal 7 & Drupal 8)

Maybe you encountered this problem before: a user tries to log in, but forgot his/her password. After several failed attempts Drupal blocks the user for some time. And that block cannot be made undone by an admin in the Drupal backend; only directly via the database.

This module is solving that problem and other problems:

  • An admin screen to unblock blocked users.
  • Log IP addresses of spammers and block them.
  • Create a white list of IP addresses; only those IP’s can from now on send (login) forms.

https://www.drupal.org/project/fbip

11. Safe cache_form Clear

Drupal’s cache_form table can quickly become quite large and clog the system, but with a ‘clear all caches’ Drupal is throwing away everything that can cause performance issues.

This module is solving that: it will only clear small bundles (chunks) of this cache table. Easily manageable chunks for Drupal which will avoid performance issues.

It only works in combination with database cache tables, not when you are using for example external caches likes Memcache of Filecache.

(Drupal 7)
https://www.drupal.org/project/safe_cache_form_clear

12. Search API attachments

By default Drupal indexes only content from nodes. If you are also working with attachments in Drupal I can imagine that you also want to index the contents of those files, so that they are included when visitors are performing searches in your Drupal site.

This module is helping with that, it is an add-on for the Search API module and requires the Apache Tika Library. It also runs on Apache Solr. Solr is preferred otherwise your database can quickly become too large, which results in time consuming searches and visitors dropping out.

(Drupal 7 & Drupal 8 alpha)
https://www.drupal.org/project/search_api_attachments

13. Navbar Awesome

An add-on for the Navbar module. The Navbar is a common used module for Drupal 7 providing easy and responsive backend navigation. It is similar to the default navigation bar in Drupal 8.
This Navbar Awesome module gives the Navbar a more ‘clean’ and modern look.

(Drupal 7 beta & Drupal 8 beta)

https://www.drupal.org/project/navbar_awesome

14. Taxonomy unique

Do you want to make sure that all terms (keywords/tags) entered in one Drupal vocabulary are unique? After installing this module Drupal will check if that is the case. When you enter a term that is not unique, then an error will be shown.

(Drupal 7 en Drupal 8 beta)
https://www.drupal.org/project/taxonomy_unique

15. Nagios

??????????When you are managing many Drupal sites then central active monitoring can save a lot of work. This module integrates monitoring using Nagios. It checks, among others, the following components:

  • Is the database accessible
  • Is cron running well
  • Should Drupal core or modules be updated
  • Is PHP running well (in case PHP for some reason drops out)
  • Is the database structure (schedule) running behind
  • Is the ‘files’ directory writable
  • Other status messages, which can also be seen in the ‘Drupal Status report’.

(Drupal 7 & Drupal 8 dev)
https://www.drupal.org/project/nagios

16. Rename Admin Paths

An additional security for your Drupal backend. With this module you can change the default backend paths such as /admin/... and /user/... into something else. So spambots, hackbots and hackers do not know which URL to use.

(Drupal 7 en Drupal 8)
https://www.drupal.org/project/rename_admin_paths

17. Login destination

After a user logs in, you might want to refer him/her to a particular path, such as his/her personal dashboard. This small, popular module allows you to easily set this up.

(Drupal 7)
https://www.drupal.org/project/login_destination

18. Memcache Storage

When you are managing a high performance Drupal site, then chances are that you have implemented the Drupal Memcache module. This module is only an integration and gives statistics per page about the Memcache use, but does not provide any other administrative tasks herein.
This module is an alternative and does offer additional administrative tasks for the Memcache actions within your Drupal system, including:

  • What caches are stored where (Memcache or database).
  • ‘User sessions’ and ‘locks’ can also be stored in the memory.
  • Separate empty caches / Memcache bins.
  • Drush integration.
    ????
    (Drupal 7 en Drupal 8 beta)
    https://www.drupal.org/project/memcache_storage

19. User Password Reset Link Timeout

Once you create a user within Drupal you can send a one-time login link; which is by default valid for 24 hours. This period cannot be set automatically, after installing this module it is.
We recently used it with an implementation of Drupal social intranet OpenLucius, in which we first imported users and then sent a login link simultaneously via the Mass Password Reset module.

(Drupal 7)
https://www.drupal.org/project/user_pwreset_timeout

20. Force Password Change

For better protection of the data of your users, it is recommended that they periodically change their passwords. This is not forced by default in Drupal; this module can take care of this.

(Drupal 7)
https://www.drupal.org/project/force_password_change

21. Dummy image

When you are developing on your localhost, then usually you do not have all images from a live environment stored on your local computer. This is resulting in lots of broken images and delays in page loads.
This module makes sure you get to see dummy images so that it is not needed to constantly sync all images from live and yet it is possible to test them locally.

(Drupal 7 en Drupal 8 alpha)
https://www.drupal.org/project/dummyimage

22. Stage file proxy

Another solution to the same problem described above: when you have not stored all files and images locally. When you install this module and it finds an image that is locally not found, then it copies the image from live to local. It only does this for the pages you visit locally so you need minimal disk space; especially handy when dealing with a large site with many files/images.

(Drupal 7 en Drupal 8 dev)
https://www.drupal.org/project/stage_file_proxy
????????

Wrap up

That's all folks. Next month again a new 'cool Drupal modules' blog. Stay tuned!

Dec 17 2015
Dec 17

This headless Drupal website was launched a few months ago. When I checked Google's Page Speed I was shocked: a score of 57 out of 100, not good! Speed is one of the most important parts of a website, when a website is slow:

  • Visitors will quickly leave;
  • Google will give your website a bad rating resulting in bad SEO results;
  • You will get a bad Ad rank within Adwords; this will cost you a great deal of money.

Since we are now running our frontend on Node.js / Express JS I thought: that Page Speed will hit the ceiling. But the opposite was true, check the rating after going live in the below figure: a very disappointing red rating. Caused by not using 'gzip compression'.

GZIP compression? Uhm…. what? Why?

Read here about gzip compression.

A visual explanation:

Source

Compression in a standard Drupal installation

When using a standard Drupal installation (not headless/decoupled), then it is easy to enable this compression.

  1. Go to /admin/config/development/performance
  2. Check ‘Cache pages for anonymous users’
  3. Check ‘Compress cached pages.’

Note: If you are using this Drupal compression, do not enable it on web server level (Apache mod_gzip).

Logged in or logged out?

This is sufficient if you have a Drupal website with mostly not logged in (anonymous) visitors. Caching is a different story (and a specialty) when you are dealing with a drupal website where many people are logging in, as with any Drupal social intranet, webshop or online community. More info on caching in Drupal 8. Also refer to A Beginner's Guide to Caching Data in Drupal 7.

Compression in headless Drupal with Node.js frontend

As indicated, we are using Drupal headless (decoupled). Therefore the standard compression of Drupal is not working. So we searched for a way of gzip compression for Node.js. We found it here.
Installation

  1. Install this popular NPM module with the following command in your terminal: npm install compression
  2. Add the following code in your ‘main app file’:

That’s all :-). Quickly add, commit, push and then pull to the live server et voila:

Still not 100% optimal, but we are getting there!

You can also do an additional test on gziptest.com:

Wrap up

Alrighty, that’s all folks. Questions or feedback, let me know!

Dec 10 2015
Dec 10

Deze week hebben we een update doorgevoerd van OpenLucius. Naast vele kleine optimalisaties zijn dit de belangrijkste verbeteringen:

1) Open groepen: makkelijk organisatie-breed communiceren en documenteren

In vorige versies van OpenLucius waren alleen gesloten groepen mogelijk, nu kan je ook open groepen aanmaken. Veel gebruikers miste namelijk een centrale informatie voorziening binnen OpenLucius, waar bijvoorbeeld opgenomen:

  • Organisatie-breed nieuws
  • Centrale documenten
  • Centrale pagina's (voor bv huisregels en kwaliteitshandboeken)

Voordat deze update werd doorgevoerd moest je een groep aanmaken en iedereen daarin plaatsen, nu kan je simpelweg een open groep aanmaken waar iedereen direct toegang heeft.

  1. Gesloten: alleen toegevoegde groepsleden hebben toegang
  2. Open: iedereen heeft toegang. Optioneel kan je klanten wel of geen toegang geven in een open groep.

Open en gesloten groepen zijn makkelijk te herkennen door het gesloten/open slot icoon:

Het aanmaken van een open groep is eenvoudig:

  1. Maak een nieuwe groep aan
  2. In het scherm waar je een groep aanmaakt: vink 'Open groep' aan:

Een aangemaakte groep kan makkelijk gewijzigd worden van open naar gesloten of andersom.

2) Makkelijker navigeren

We kregen veel feedback dat de navigatie binnen groepen wat onlogisch was. En daar waren we het mee eens, een update hierin kon niet uitblijven:

  1. Zie direct of een groep 'Open' of 'Gesloten' is.
  2. Navigatie binnen groepen, deze navigatiebalk blijft permanent staan, waar je ook bent in de groep.
  3. Je kunt nu een logo, cover image en slogan toevoegen op het groepsdashboard.

3) Vind nu nog sneller expertise: tegelijk zoeken naar alles én iedereen

Vind nu nog sneller expertises bij mensen binnen je organisatie, waar je wellicht geen idee van had!

Als je een zoekopdracht uitvoert zal OpenLucius nu tevens zoeken in profielgegevens van alle gebruikers. Dit wordt direct handig aangegeven met een 'badge' boven de Leden-tab op het zoekscherm: die badge attendeert je erop dat er tevens resultaten gevonden zijn bij profielen.

Alles wat in profielen van leden staat wordt meegenomen, denk aan: 'over mij' tekst, expertises, telefoonnummer, adres, email adres en overige velden die je zelf toevoegt aan profielen.

Zodra je gaat zoeken zie je direct of OpenLucius ook iets gevonden heeft bij 'Leden' en plaatst er dus een rode badge bij:

Klik je vervolgens op de Tab 'Leden' in dit zoekscherm, dan zie je de profielen die gevonden zijn.

Vandaar dat 'Zoeken' in het hoofdmenu voortaan heet: 'Alles en iedereen' zoeken.

4) E-mail notificaties beheren

Notificatie worden altijd weergegeven in het notificatiecentrum, maar ook per e-mail toegezonden. Vanaf nu is het mogelijk deze e-mails uit te schakelen. De notificaties in het notificatiecentrum blijven wel actief, zodat je direct een overzicht hebt van belangrijke ontwikkelingen als je inlogt.

5) Groep activiteit

Binnen groepen kan je nu de activiteit zien van die specifieke groep. Op de homepage kan je nog steeds de activiteit van alle groepen bij elkaar zien.

Overige tweaks en fixes

  • De todo breakdown functie is geoptimaliseerd
  • Notificaties: het 'teams' blok wordt niet meer getoond als er geen teams zijn toegevoegd aan de groep
  • Secundaire, extra informatie staat nu in de rechter zijbalk. Bijvoorbeeld: de vervaldatum van een todo
  • Beheer groepsleden: admins kunnen nu mensen in bulk uit groepen verwijderen: door het profiel van een gebruiker aan te passen en simpelweg vinkjes bij betreffende groepen weg te halen
  • Extra witte rand om badges in het hoofdmenu, zodat er altijd goed contrast is met de gekozen kleur van het hoofdmenu
  • Persoonlijke todo's: diverse fixes
  • Alle filters in de rechter zijbalk zijn nu mooier uitgelijnd en beter bruikbaar op mobiel
  • Reacties bij berichten staan nu op 300 per pagina
  • Mobiel: geoptimaliseerd 'wijzig item' scherm
  • E-mail notificatie: achtergrond is nu grijs
  • Paginanummer bij bestanden gefixt
  • Diverse Nederlandse vertalingen doorgevoerd
  • Groep slogan staat nu mooi uitgelijnd, ook mobiel
  • 'Me' heet nu 'Login' op het inlogscherm
  • Todo velden weg gehaald bij en wijzigen van een reactie op een bericht
  • Verplaatsen van items: groepenlijst staat nu alfabetisch
  • Tekst documenten: de previews zijn nu 100% klikbaar, niet alleen de titel meer
  • Als je de open source versie zelf installeert, is er nu een extra stap tijdens het installatie proces om de locatie van je bestanden direct te configureren:

That's all folks!

Vragen of feedback, let me know.

Happy samenwerking!

Dec 03 2015
Dec 03

Several times the last few months we received the following question: what about the safety of our files that we upload in our Drupal social intranet? Is it possible to encrypt the files to provide an additional layer of protection to sensitive information?

Public files
In a standard Drupal installation uploaded files are not encrypted, which means they can be opened when you have access to the directory on the server. If you have a public website, this is not a problem. Your images and downloads are freely accessible to everybody.

Private files
If you have a Drupal social intranet, then it is recommended to make files 'private'. This means they are not freely accessible, except to people who receive the explicit permission to do so. This 'private files' option is a standard feature in the Drupal core.

Encrypted files
One step further is to encrypt files, making them unreadable unless you have the keys. When unauthorized users somehow get their hands on the file, they will not be able to see the content.
Whether Drupal gives you the keys to the file is determined by Drupal's node access system, using grants. The Drupal module ‘Encrypted Files’ provides the encryption of files. Here's how to implement this:

Installation and configuration ‘Encrypted files’

1. Download and install 3 modules

2. Set AES as default

Go to admin/config/system/encrypt and click edit:

Then you can configure the 'Encryption method’:

In the tab ‘Encryption method setting’, select ‘Mcrypt AES 256’. AES is stronger than the default.

3. Configure ‘Default download method’

Go to admin/config/media/file-system:

  1. Make sure the private files are outside the public webroot (1).
  2. Set the ‘Default download method’ to ‘Private, encrypted local files served by Drupal’ (2).

4. Configure a new ‘File field’

When a new file field is added, you will now get the option ‘Encrypted files’:

5. Test it

Upload a file via the newly added field in the particular content type. When the file is then opened directly from the server, you will get to see an encrypted version:

Key issues

IMCE

When using image galleries like IMCE, then there is a chance they are not working well.

Protect the keys

The module saves one of the keys in the private files folder; set the permissions on those files and folders as strictly as possible. Your server should be able to read and write to these files, any other user should not have access.

Whether this is possible depends on the configuration of your server, such as under which user the Drupel social intranet is running. For example, if Drupal runs under the same user as the one who is managing the private files folder and its files, then you can give the appropriate directory permissions 700 and the files 600.

This Drupal module stores the second key in the database, therefore also ensure an optimal protection of your database, examples:

  • Use a strong password for the database user that Drupal uses.
  • Only allow this user access to the database.
  • Set a strict permission on your settings.php.

Further general safety measurements

  • Periodically change your server passwords with strong combinations.
  • Turn off all unnecessary services on your server.
  • Only allow key-based SSH access.
  • Filter by IP: allow for example only the IP of your office.

Sources:

Nov 26 2015
Nov 26

So.... Drupal 8 got released! Congrats everybody! The end of life of Drupal 6 is then final. In addition, the 16th of november it was announced that Drupal.org is now serving its content and files via Fastly; which is giving a significant performance boost, well done!

Furthermore, what I noticed last month on module updates:

1) Scroll to destination anchors

This module modifies the behaviour of an ‘anchor’ within a page. So the page will not jump down but fluently scroll down. We have installed this module here.

https://www.drupal.org/project/scroll_to_destination_anchors

2) Spider Slap

There are a lot of ‘evil spiders’ active on the internet. These are web crawlers that don’t respect what is written in your robots.txt. This can cause unnecessary load on your server and uncover information that you don’t want to see in a search engine.
This module is solving this problem. It will block the IP when a spider does not behave, with as a result that it will no longer have access.

https://www.drupal.org/project/spiderslap

3) Bounce Convert

Do you want to make an announcement in the last moment before a visitor is closing your Drupal website? Then this module can be useful. It functions like Exit monitor or Bounce Exchange.

Introduction video.

!) Note that it is currently an alpha module, so not yet suitable for live Drupal sites.

https://www.drupal.org/project/bounce_convert

4) Database Email Encryption

Do you want to maximise the security of the email addresses of your registered users? This is possible with this module. It encrypts the addresses in the database. Should the database end up in the wrong hands, then the email addresses cannot be read. Encryption is done using AES.

https://www.drupal.org/project/dbee

5) Unique field

A popular module existing since Drupal 5, but I never noticed it before. It is performing a check on entered fields (e.g. title field) and checks whether the entered title is unique. This will prevent the use of double titles which is good for, among others, SEO.

6) Login History

By default Drupal is not creating a login archive. This module will do this for you: it creates an archive in which the history of logins will be stored.

https://www.drupal.org/project/login_history
Similar:
https://www.drupal.org/project/login_tracker
https://www.drupal.org/project/login_activity

7) Sitemap

Generates a sitemap for your Drupal 8 website and can also create RSS feeds for example for your blog. This is the Drupal 8 version for the popular Drupal 7 module Sitemap.

https://www.drupal.org/project/sitemap

8) D8 Editor File Upload

Easily place files in content. This Drupal 8 module adds a new button to the editor, which will make it easy to upload and place files.

https://www.drupal.org/project/editor_file

9) Client side Validation

Validating a form in your Drupal website without refreshing the page. This widely used module now offers a Release Candidate for Drupal 8.

https://www.drupal.org/project/clientside_validation

10) App Link

Probably you recognize this one: the message above a website on your Smartphone that you can view the page in a native app. If you built and linked an app (e.g. via DrupalGap) then you can generate this ‘app message’ on your Drupal website using this module.

https://www.drupal.org/project/app_link

11) OpenLucius News

An own module that has to be mentioned;). This module extends Drupal social intranet OpenLucius with a ‘news tab’ on the homepage. News about the organization can be placed here.

https://www.drupal.org/project/openlucius_news

12) Simple XML sitemap

The title of this Drupal 8 module says it all: it provides an XML sitemap that you can upload to search engines, so you can see the indexation of all your site links in the relevant search engine.
The module also has a few configuration options like setting ‘priority’.

https://www.drupal.org/project/simple_sitemap

13) Session Limit

Tighten the security of your Drupal system by limiting the number of sessions with which a user is logged in. You can for example set that somebody can be logged in once; if somebody is logging in on his/her Smartphone then he/she will be automatically logged out on the work computer.

https://www.drupal.org/project/session_limit

14) Login Security

Provide additional security when logging in, it is for example possible to:

  • Set how many times a user can attempt to log in before the account is blocked.
  • Deny access based on IP, temporarily or permanently.

The module can also send emails (or a log to Nagios) to alert the Drupal administrator that something is going on:

  • It seems that passwords and accounts are guessed.
  • bruteforce attacks or other inappropriate behaviour when logging in.

https://www.drupal.org/project/login_security

15) OpenLucius LDAP

Another own module, that should be mentioned as well ;-). This module extends Drupal social intranet OpenLucius with a LDAP connection, so that users can login to OpenLucius with their existing LDAP account.

https://www.drupal.org/project/openlucius_ldap

16) Protected node

Gives additional protection to a certain page (node). A password can be set when creating the node. If somebody then wants to look at the node, the password must be entered to get access.

https://www.drupal.org/project/protected_node

17) Code per Node

It is common to ‘deploy’ Drupal code (PHP, JS, CSS) via GIT within an OTAP street to a live Drupal server. Usually with the use of a Continuous Integration tool.

[edit] As Eelke mentioned in the comments below: OTAP has to be DTAP for English audience. [/edit]

But with this module you can perform quick fixes per page without the whole operation. It offers the opportunity to add additional CSS; per node, content type, block or global.

Not how we would do it, but I can imagine that this could be a handy tool for Drupal site builders. This is probably also the reason why it is so popular.

https://www.drupal.org/project/cpn

18) Admin Toolbar

A handy toolbar for Drupal 8

https://www.drupal.org/project/admin_toolbar

Wrap up

Alright, these are the modules for this month. In December we will introduce again new ‘cool Drupal modules’, so stay tuned!

Pages

About Drupal Sun

Drupal Sun is an Evolving Web project. It allows you to:

  • Do full-text search on all the articles in Drupal Planet (thanks to Apache Solr)
  • Facet based on tags, author, or feed
  • Flip through articles quickly (with j/k or arrow keys) to find what you're interested in
  • View the entire article text inline, or in the context of the site where it was created

See the blog post at Evolving Web

Evolving Web