Take your daily dose of (only) relevant news, useful tips and tricks and valuable how to's on using the latest web technologies shaping the digital landscape. We're here to do all the necessary information sifting for you, so you don't have to, to provide you with content that will help you anticipate the emerging trends about to influence the web.

Consider These 5 Aspects When Picking Your Base Theme in Drupal 8
Don't you just feel the sweet taste of new possibilities right now?   And still, any new Drupal 8 project comes with its own set of challenges, as well, and choosing a theme, from the very start, is probably one of the greatest ones.   What should it be then?   Should you go for a classic base theme (AdaptiveTheme or Zen, maybe), for a contributed theme instead or maybe you prefer implementing the framework yourself or build your very own theme, from scratch, relying on Drupal core?   Before you make the decision that will have a huge impact on your whole project's structure, take some time to go through this quick “quizz” here and try to give yourself some clear answers:   are you dealing with a multi-site project (meaning that your theme, once chosen and implemented, will be used across all the other websites, too)?   is the person maintaining the theme a HTML guru or a CSS expert?   will this theme be used just on the website itself or for internal apps as well?   what level of front-end performance optimization does it imply?   Classy vs Stable: Which Base Theme Works Best for You?   This might just be the most important choice to take during your Drupal project's life-cycle!   It's your theme that dictates/overrides your CSS, JS and Drupal's markup, you know. Where do you add that your chosen theme can feature a parent-child relationship, where the sub-theme inherits the base theme's templates, JS and CSS.   In short: think through your theme choice for the sake of your project's success and your whole workflow!   “And still, which one to choose: Classy or Stable?”, you might ask yourself.   Here's how you can tell which one suits you (as a Drupal developer, with certain goals in mind and with a certain theming experience) and your particular web project (which comes with its own set of particularities):   are you planning to add classes only where the context demands them? Then Stable's The base theme for you! do you want lean markup, with very little classes (e.g toolbar and contextual links), giving you the freedom to customize your own markup patterns in your theme, to create only those classes that are required by your project? Stable again, is the “lucky” word, in this case!  do you want to have a set of classes at your disposal, to tweak and use as styling hooks, right from the starting point? Then it "write" Classy all over your Drupal project!   This being said, let's see which are the 5 factors that you should consider before you choose your Drupal 8 base theme:   1. How Much CSS and Markup Updating Does it Require?   How much CSS out-of-the-box does your chosen theme come “equipped” with?   It makes a great difference, you know. Take these two examples for instance:   You decide to build your website on Classy theme, which in Drupal 8 comes with very little core CSS, so you will have to write your own classes and occasionally even to override the templates, depending on what you want your classes to style.    You're building your theme on Zurb Foundation or Boostrap, which come with their own of out-of-the-box classes that all you need to do is apply to your markup. What's important for you to keep in mind, if you incline for this particular work scenario, is that once you have your Drupal site built, there's going to be a lot of template customization to do for adding all those out-of-the-box classes to your site's new components!   2. Has Your Client Expressed Any Preference?   Your client may or may not come with his/ her own preferences when it comes to the theme that you and your team should to build his website on.    Be sure to have one aspect settled with your client, during your before-the-project meetings: are you supposed to maintain the theme that you two will decide upon on the starting point or is there a chance that this should be replaced with a new one, as the project unfolds? It's essential that you discuss this aspect with your client, for it's important for both of you to consider the learning curve (and implicitly the extra time) of each new theme.   In case your client has no specific preferences regarding the theme to be used for his site, your own theming experience and your development process preferences will be the only factors that will influence your theme choice!   3. Consider the Design    It's no news for any developer, no matter his/her level of experience, that Drupal is tremendously flexible! When it comes to theming, it allows you to build practically anything you want: ranging from a large web app, to great customer-facing websites in the latest design and functionality trends!   Depending on what exactly you need to design in Drupal, you get to choose among several platforms:   Ember or Adminimal make some great administrative themes, that will do their job superbly helping you build your back-end app   Zurb Foundation or Bootstrap make great choices if your web project includes components such as tables and forms    4. Will You Be Using a Pattern Library?   A base theme always makes the perfect choice if you're planning to create your own patterns.   In other words: keep it simple, at the theme level, especially if you'll be applying your own classes, which will then get themed by your own pattern library styles!   5. Consider Performance   Less is always better! You keep that in mind and let this common-sense motto guide you through your theme selection!   The more functions, JS libraries and settings your website needs to load, the heavier its “burden” will be (and the longer its load time will be, as well).   Go for a light theme based on Drupal core, which won't come equipped with its own heavy load of out-of-the-box JS libraries and CSS and remember that if less is always more, so does “testing makes it perfect”!   Remember to test all the theme settings on your website, thus keeping its front-end performance closely monitored!     These is our list of factors that any Drupal developer should take into account and think through before choosing the base theme for his/her project. Do you have any other aspects that you usually consider and which determine you to go for a specific base theme or another once you start your Drupal web projects? ... Read more
Adrian Ababei / Dec 12'2016
Get Started: Build Your First Custom Module in Drupal 8
So, you could not resist the temptation to try out the much-praised Drupal 8! You've installed it, you've already “played” with its core modules, its contributed modules and that's it? Don't you think it's about time you leveled up your Drupal 8 skills?   The next step to take is learning how to team up your own skills and knowledge with Drupal 8's full potential for putting together some amazing custom-made modules. Modules that would instantly add extra value to the sites you'll build.   Don't let the “rumors” stating that the whole custom modules building process is so different, and therefore more challenging, from Drupal 7, that it's lengthier and way too discouraging.    We're here to show you that it takes just 8 quick and easy steps for you to create new modules (to meet your sites' specific needs) in Drupal 8! Walk us through all these steps:   1. File Structure    It's under modules folder in the root directory that you should keep both your contributed and your custom modules in Drupal 8:   modules/contrib/   modules/custom/   So, go ahead and get your first custom module started by creating a folder in your Drupal installation at the path: sites/all/modules/custom/sa_module.   Keep in mind: If you're configuring multiple sites, you need to use modules specifically for each one of them:   sites/your_site_name_1/modules/   sites/your_site_name_2/modules/   2. Create the .install file   A Drupal schema (representing one or more tables and their related keys and indexes) is defined by hook_schema(). You'll find it in modulename.install file. hook_schema() and it should return an array mapping ‘tablename’ => array (table definition) for one of the tables defined by the module.   3. Create the .info.yml file    That's right, you have a “info.yml” file extention in Drupal 8 (replacing the “.info file” that you got used to using Drupal 7). It applies to profiles modules and themes, too.   So, that being said, you now need to create your .info.yml file (i.e., thus letting Drupal know about your new custom module. Your file will look something like this:   name: Drupal 8 custom module example type: module description: 'Example for Drupal 8 modules.' package: Custom version: 8.x core: 8.x   Follow this path for enabling your module: OR Click on Extend from Menu.   4. Create the .routing.yml File    When it comes to handling routing in Drupal, you'll be using Symfony 2 components. The routing file that you'll create will help you navigate into Drupal using the method of a controller class (meaning that you'll be specifying different controller actions).    You'll be writing the path in routing.yml file and the resulting file will look something like this:    example.my_page:   path: '/mypage/page'   defaults:     _controller: '\Drupal\example\Controller\ExampleController::myPage'     _title: 'My first page in Drupal8'   requirements:      _permission: 'access content'     1. The first line is the route (a symfony component mapping an HTTP request to a set of configuration variables).   Define your route as a module_name.route_name ‘module_name => sa_module’ ‘route_name => list’.     2. The second line is the path: you'll need to specify the path that this route should register to, in short: the path (of the module) where the users will be redirected. See the leading forward slash “\” in the URL to the route from our example.     3. The third line shows your defaults: you get to specify several things here. For instance, in our above example we have 2 defaults:               _contoller: referencing a method on the ExampleController class                _title: the default page title   You, could, for instance, have "_form" define classes under defaults, as well, helping you define the forms included in your custom module (for example EditForms, DeleteForms, AddForms)     4. The fourth line displays requirements: here you get to specify the type of permissions to be granted to your users for accessing specific pages on your website: “add”, “edit”, “delete” and “access” for instance.   5: Create the .module file     Unlike in Drupal 7, where the hook menu() defines page callback functions, in Drupal 8  it defines menu items exclusively.   Make sure that the path and the route in which in your example.module matches the ones written in your example_module.routing.yml.    Let's have a look at our above-example, for instance: there the route 'route' => 'example.my_page' in example.module should be identical to example.my_page: in example.routing.yml     6: Create Controller Class    First, a few words about “controller”:   it may contain multiple types of arbitrary logic that your site needs for rendering content on a certain page   it's a php function that processes the HTTP request and returns a response   Create a “modules/custom/sa_module/src/Controller" folder and then (within the same folder) a file named AdminController.php.   7. Create Model Class and Forms    Once you've set up your AdminController, you need to introduce a model class (i.e. SaUserInfo.php) in order to link it to your database. It's this model class that you'll create now that will help you set up methods like add(), delete(), update() etc.   8. Create Menu on Admin   One more step and you're ready to launch your very first custom Drupal 8 module right from the Admin Panel ! Create a file, which will set Menu at the Top.     And this is it! 8 quick and easy steps for building your first custom module in Drupal 8! Give it a try! ... Read more
Adrian Ababei / Dec 02'2016
Here Is How You Add Responsive Images To Your Drupal 8 Website
  Proudly wearing its “mobile-first” aura, Drupal 8 is here to help you deal with the issue of responsiveness nice and smoothly. No need to write miles of code anymore, to master the art of pulling off HTML, back-end languages and JavaScrip combos anymore.    In other words: Drupal 8 is here, have no fear! It projects a new world of easy-to-build responsive themes.   It simply “spoils” you with an easy-to use responsive image setup (which comes in its core, another great news). Basically, it puts an image formatter and breakpoint mappings at your full disposal so that you can have your due-sized images, using HTML 5 picture tag, ready in just a few quick steps. Thus, you'll get your images adapted to every device's viewport in no time.   Well, not really “in no time”, but in 5 simple steps! Walk us through this step-by-step demo:   1. Turn on Your Responsive Image and Breakpoint modules You've got that right: the Responsive Image Module is part of core Drupal 8, you get it upon installation and yet, if you want to use it you still have to first enable it. It's the same thing for the Breakpoints module, as well.  How do you enable the Responsive Image Module in Drupal 8 you say?   You go to /admin/modules   You click the check box close to “Responsive Image”   You click the “Install” button   2. Set Up Your Breakpoints “What is a breakpoint?” you say (if you're new to Drupal)? It's a window width that you get to set up, thus letting Drupal know that it should start using a different size image starting from that particular width size. Got it?   Do you remember how things used to be in Drupal 7's Breakpoint module (oh, the (not so) good old days when Breakpoint was a contributed module!)? You could define your breakpoints in your admin interface. Well, not anymore! In Drupal 8 you have to set them up in code.   If it's a pre-built theme that you're using, there's a high chance that your breakpoints are already set up. If you're creating your own theme instead, then you need to set them up yurself in breakpoints.yml file.   So, here is how you set them up (make sure you start with the smallest ones):   your_theme_slug.bannerImage.narrow:   label: narrow   mediaQuery: ''   weight: 0   group: Banner Image your_theme_slug.bannerImage.wide:   label: wide   mediaQuery: '(min-width: 600px)'   weight: 1   group: Banner Image    3. Create Your Image Style  What image styles do you want for each one of your previously defined breakpoints?   Once you've answered yourself that, go ahead and set them up (after you've done a bit of math setting up your breakpoints):   Go to /admin/config/media/image-styles/add   Type in your image style's name (we suggest you go for something descriptive) and click “Save”   Click “Select a new effect” (you'll find it there, under “Effect”, in the next screen that will open up once you've clicked “Save”)   Click “Scale and crop”   Enter the width and height sizes   Click “Add effect” Et voila! Can you go through all this process all by yourself now? For you still have to go back and create image styles for each one of the breakpoints that you've (virually) set up, you know.    And this is how Drupal automatically resizes all the images, that you'll upload on your site, to the image styles that you will have defined. And it doesn't do all this the rudimentary way, no sir: first it sizes the image, then it crops off the extra so that the result should be a perfectly adapted new image (not the stretched or the shrunk, very unnatural looking type)   4. Define Your Responsive Image Style  After you've created images styles for each breakpoint, go ahead and put them all together in a responsive image style.    Go to /admin/config/media/responsive-image-style   Give the “Add responsive image syle” button a click   Give your style a name (go for something easily recognizable)   Select the “Breakpoint group” (you know, the one that you've set up at step no.    Select the breakpoints one by one and associate them each with one image style   Can you see the option for fallback image style there, at the bottom? It's the “default” image that Drupal generates for those browsers that don't support responsive images (such as Internet Explorer 8). We recommend you to select the largest image style!   5. Allocate Your Responsive Image Style to An Image Field Just one more quick step to take and you can upload images on your website and let Drupal do all the formatting/smooth resizing job for you! Before it can do that, you still need to let it know what image field to actually responsify for you:   Click on “Structure”- “Content Types”   Click the arrow close to “Manage Fields” and then click “Manage Display”   Spot your target image field (you'll see the entity type, ranging from taxonomy vocabulary to content type that your image field is assigned to)   Select “Responsive Images” (under “Format”)   Pick one of the responsive image mappings that you will have set up (under “Responsive image style”)   Click “Update”     And that's it! You've provided Drupal 8 with all the settings it needs for “working its magic”: pulling off images of appropriate sizes without comprising their quality. ... Read more
Adrian Ababei / Nov 29'2016
Here is how you do a Drupal 8 migration
Here you are, facing a major challenge: you'll be moving your “precious” site (or your client's site, but still “precious” for him/her and for your own reputation) to Drupal 8! This is process is called: the Drupal 8 migration.   What if something goes terribly wrong? What if you lose valuable information during the process? What if the final look and functions turn out to be less amazing than what you've already heard and read about the highly praised Drupal 8?   No need to freak out, we're here to reassure you: you've taken the best decision!   Moreover, we're here to help you with a risks-minimizing and workflow efficiency-boosting guide that will show you how to upgrade your dear website and have it running in Drupal 8 in no time! It's all about a little bit of planning and putting all the implied processes into place, that's all!   Speaking Drupal 8 migration, just to make it clear, we'd like to mention that: although the whole website migrating process includes configuration migration, updating your websites theme and content migration, too, we'll be focusing on content migration only in this post (by far the most "daunting" one).   Effective Drupal 8 migration: Its 5 Main Phases Before you proceed with any one of your future Drupal 8 migration projects, we strongly advise you to take your time to go over these 5 major steps to take if you want to ensure your projects' success:   1. Audit Your Source Site:  analyze the site to be migrated, see how its content is structured, how it looks, what it uses to examine its taxonomy terms, users, menus, fields, content types, in a few words: don't let anything skip your "inspection"   2. Plan Your Data Model: once you've closely analyzed the source website, it's time you (and your team and client) took some major decisions: what stays on, what should be removed, what corrections/modifications should be performed. To put it simply: it's now that you plan out the content that the future Drupal 8 site will display     3. Get Everything Prepared for Migration: at this stage you'll first overview and then make use of the contributed modules, you'll work with Migrate API, configure and run your migration    4. Put Together Your Migration Strategy: hopefully (for this is the best practice for reducing downtime) at this phase of the whole migration process you'll opt for a near-continuous content migration variant   5. Launch Migration: set up a timeline and be prepared to mitigate any risks that might arise (either before or post launching)   A Drupal 8 Content Migration Example   Before we proceed with the “enlightening” Drupal 8 migration example that we've promised you, let's have a quick look at the modules which will make the whole “transition” to Drupal 8 possible?   Migrate Module: part of Drupal 8 core, this module will serve you both with the content and the site's configuration migration process   Migrate Plus: comes with additional functionality (you get to migrate from XML, JSON and CSV formats)   Drupal Upgrade: it's the one to install if you want to operate in a web interface (which will enable you to specify the files directory and the database of your core site. Once the migration has been completed, you'll get to see all the successfully migrated entities in the report that it will provide you).   Warning!!! Don't forget to back up your future Drupal 8 website!   Now here's that migration example! It briefly describes all the steps to take for migrating the files that Drupal 8's Migration module won't migrate (images here included).   1. Migrate Your Website's Background Let's imagine the following task from your Drupal 8 migration project: you need to import TV shows into Article nodes (from Tvmaze's JSON API).   You'll have to define our YAML file, migrate.migration.shows.yml:    id: shows label: 'TV shows' source:   plugin: json_source   path: ' identifier: id   identifierDepth: 1   headers: {  }   fields: {  }   constants:     type: article     format: restricted_html destination: plugin: 'entity:node' process:   title: name   body/0/value: summary   body/0/format: constants/format   type: constants/type   Can you identify the 3 main section here?   source: it informs migrate about the “source” that our content comes from .  destination: it lets migrate know what exactly is it that we want to generate (in the above example: nodes) process: this section informs migrate that it should turn JSON into Drupal fields (summary turns into node body, while the name from JSON becomes the node title)   2. Write a Process Plugin The next step one on our wish list is “adding images”.   Since it's not the URL of the poster image that we'd like to add, but its contents themselves, we face the second challenge of this 3 steps migration process: writing a process plugin (since there's none, already available in Drupal 8, that actually downloads a URL) that will enable us to transform our URL.   So, we inherit from ProcessPluginBase and apply the transform() method which handles $value as a URL.   Next, once we get our plugin's name (file_import), we'll update our process section:   process:   # snip   field_image:     - source: image/original       plugin: file_import   3. Run Migration Here are the 3 last steps to take for finally running your content into the Drupal 8 migration process:   check whether all the proper modules are installed: the Migrate Tools module,  migrate_source_json and the custom one, with the process plugin that you will have already written import your YAML file  run migration with Drush's migrate commands:  drush migrate-import shows   And this is how you migrate images and other types of files (other than SQL dumps or JSON files) to Drupal 8! Was is hard? Do you find the Drupal 8 migration of content a complicated process? Feel free to share your thoughts! ... Read more
Adrian Ababei / Nov 25'2016
10 Steps To Build Your First Drupal 8 Site
  Has all the craze about Drupal 8 got to you, too? Have you started to "fantasize" about it:   tempting easy-to-customize components   HTML5, mobile-first input   quick edit feature   responsive admin   100 languages feature   and all the other "hard to resist to goodies" that the latest version of Drupal comes enhanced with?   Well, my friend, it's time you stopped fantasizing about it, bid farewell to good old, familiar Drupal 7, and level up to Drupal 8.   In order to make this "breakup" easier for you, we've put together a how-to guide that will help you build your very first website in Drupal 8 as quickly as you say: "Drupal!".   You won't believe how quickly you'll have your Drupal 8 site running and looking great!     1. Instal Drupal 8   Before you rush in to install Drupal 8 on your PC, laptop/ server, make sure you have the proper "welcoming" environment for it on your system. I'm referring here to all the must-have software: MySQL, Apache, and PHP.    After all the due preparations, it's time to install Drupal 8! Here's the step-by-step installation process:   Download Drupal 8 (its latest version)   Extract the distribution (from Apache)   Create your database   Then the settings.php and the files directory, too   Run the whole installation process (by accessing your website in your web browser)   Et voila! You've just carried out step no.1. Easy peasy, right?   Now let's hurry up and put together the foundation of your first Drupal 8 website, a foundation made of 4 basic building blocks: Users, Taxonomy, Content Types, Menus.       2. Create User Accounts/Add Roles   Will there be a “one-man show” on your website, meaning that you'll be the one authoring, editing and managing all the content? Lucky you then! You can skip this step, for the admin account that you've got yourself with during the installation process will be the only one you'll need.    If this is your case, then you can just rush in to step 3!   If, instead, you'll be teaming up with a bunch of talented people for creating amazing stuff on your website, then you'll need to create user accounts and assign roles to your colleagues, right?   Here's how you do it in Drupal 8:   A. For creating new users:   Log in on your website's homepage. See the admin menu at the top? Awesome! On the menu there you need to click Manage, then, in the next menu popping up, click People.    B. For assigning roles:   Go to Permissions tab. There, on Permissions page you have a whole list of permissions available for you to assign to the various roles the users on your website will play. Select the permissions to be given to each role (what features/functionality on your website they'll gain access to).   C. For creating new users accounts   Click on the List tab, then on the Add user, fill in the right values and you will have created your first user account, apart from the admin one (which is yours).      3. Create Taxonomy   What's “taxonomy” and why do you need this fancy-named core module for your Drupal 8 site? Because it will help you build up a nicely structured content architecture. Basically, it enables you to organize your content by key terms and phrases related to the specific vocabulary used on your website.   In this respect, Drupal 8 enables you to create vocabularies made of taxonomy terms:   Go to your Admin menu, click Manage, then Structure, and last Taxonomy.    It's in Taxonomy that you get to create one or multiple vocabularies and to“populate” it/them with taxonomy terms.     4. Create Content Types   And here we are, to step no. 4, facing the content's (The King) creation issue.    Will you settle with the 2 core content types that Drupal 8 puts at your disposal upon installation, article, and basic web page, or do you crave a bit more complex templates? Templates that should include a bit more elements for your authors to juggle with than just body and title?   If you've chosen the second variant, then here is how you can quickly make your wish come true:   See the Structure link? Then do you see the Content types link underneath it? Great! Give it a click and a list of both already existing content types and a link for creating a brand new one will unfold before your eyes.   Take it from here, build your customized eye-pleasing content type!      5. Link Content and Taxonomy   OK, so you've put together your taxonomy, you've picked/created your content type, not it's time to connect these building blocks. Here's how:   add a new field to your content type select term reference (this is your field type) click Save double-check that you chose the due vocabulary and the no. of taxonomy terms that goes for each content item   6. Create and Manage Menus   Can you believe this! You're halfway through building your very first website in Drupal 8!   Who could dare underestimate the Menus' value from the user experience's point of you?    Now here's how you get to create and then manage the menus on your future amazing Drupal 8 site:   Go to Structure Click Menus (there, you'll find all the default menus that you got upon installation) Click Edit Menu (in Operations) Click Add Link Once on the Add Menu page feel free to enter your menu's title, to enter a link , too, and so on   7. Work With Blocks   Familiar already (from working in Drupal 7 maybe) with the handling of these boxes of content that you can arrange and rearrange as you want to in different regions of your website?   Now how about finding out how you can juggle with them in Drupal 8?   First of all, if you want to see all the blocks that you've got upon installing Drupal, you need to click the Structure link and then the Block layout link. All the regions (displayed in the left column) are listed there. As for the already available blocks, they're listed in the right column.   When you want to assign a block to a region, you just need to click the specific block name and then select the region that you want to assign it to, from the block configuration page.   But how do you actually create blocks in Drupal 8?   They can get created programmatically by a core, contributed, or custom module   You can create them, as well: go to Block layout page- click the Add Custom Block button   8. Expand Its Functionality    “First” doesn't have to mean “basic”, right?   So, even if you're building your very first website in Drupal 8, maybe you want to boot its core functionality.   Well, in that case, you can stay reassured. With thousands of developers backing up this version of Drupal, constantly improving it, constantly testing it, you'll no doubt find the module to respond to your specific need.    Just go to, select 8.x and “grab” the module/s that will boost your website's looks or performance!     9. Change Its Looks        Have you heard about Twig? The brand new “thing” in Drupal 8 who's replacing the “old” PHP template?   Why is Twig important for changing the look of your shiny and new site? Well, in Drupal 8 it's Twig that drives the theming system's capabilities, you know!   And since we've uttered the magic word, “theming”, here's a list of ways in which you can theme your website in Drupal 8:   select a pre-built theme  go for a starter theme (which comes with a structure and a set of pre-built capabilities, too) create your own custom theme by making all the needed configuration files   When it comes to installing a new theme, it's nothing but a sequence of 5 quick and easy steps:   Go to Appearance (in the admin menu)   Add a new theme   Download your new theme    Set your new theme as your website's default theme    Easy peasy, told you!     10. Manage Your Brand New Drupal 8 Website   Don't be just another “proud” Drupal 8 website builder, be a future-oriented one. Look for your site and keep it safe (pretty much like its parent)!   “Proactive management" is the golden phrase and here are the tasks to carry out for “proactively” looking after your Drupal 8 website:   review the log files (the Recent log, in your Reports menu will display all the errors logged by your site) back it up  constantly look for updates (Reports Page- click on Available updates) create and disable user accounts check the status report (Reports- Status)     Bravo! Now get yourself rewarded with a cup of coffee! You sure deserve it: you've just (virtually) built your first website using Drupal 8!   If you want to access proactive Drupal support for your development projects, contact Optasy. ... Read more
Adrian Ababei / Nov 23'2016
Drupal 8 Paragraphs: a fast way to build landing pages
It isn’t for no reason that we’ve called Drupal 8 Paragraphs module an “emergency kit” that Drupal 8 comes “to your rescue” with. Not only that it makes building a landing page so very time-efficient, but it “fortunately” limits your creativity freedom.   How come “fortunately”? Because the fewer options you have at your disposal, to distract you and to challenge your creativity, the more focused you are.   To put it simply: it’s the lack of options that sharpen your mind!   It challenges you to take the best decisions in short time while empowering the end user with so much flexibility (he/she can rearrange and edit the content later on). It dares you to come up with an ideally simplified (not necessarily minimalistic, although “extreme minimalism” is such a huge trend these days) result and to put the spotlight on content (that’s right, The King).   Now let us show you precisely how you can use the Drupal 8 Paragraphs module and integrate it into your team’s landing page creation process. Steps to take with Drupal 8 Paragraphs module 1. Get It Running (plus helpful stuff about handling paragraph types and fields) add the Entity Reference Revision and the Paragraphs modules to your website notice that the Drupal 8 Paragraphs module comes equipped with multiple new “paragraph” fields  notice that you get to a theme and to control the way they’ll display on the web page, as well add a new paragraph field on the target Content Type and select the Paragraph Types (Structure  > Paragraph Types) that later on the end user can administer (as a developer you practically get to create precisely those types of paragraphs that your client needs) use paragraphs independent from one another (they’re predefined) although they’re called “paragraphs”, they can take whatever    form/functionality you want; they range from images, headlines, buttons, text blocks, links etc. Each one of them is a different paragraph type with its own “collection” of fields (that you get to define) 2. Build Your Landing Page (Plus An Example) So, you’ve added the Drupal 8 Paragraphs module to your website, you’ve learned about the Paragraphs’ “juicy” features, now let’s get to work (for there was an unreasonable deadline haunting you, remember?)   First, define the paragraph bundles that you’ll be using later (using the User Interface). They come in three “versions:   simple: title+ body field advanced: title+ body+ field collection fields blocks paragraphs: title+ body+ block reference field (the cool thing about this type of paragraph bundle is that the end user gets enabled to add maps, embed sliders, views blocks etc.)   In a nutshell: you select the node you’d like to add your field of paragraph type to, then you choose the paragraph bundle that this specific fields will refer to.   Ok, now let’s imagine that we’re rushing in (we have no choice, the clock is ticking) to create a “call to action” type of paragraph.   Our long experience as landing page “creators” will then instantly unfold a list of a call to action-specific components in our mind: text, link, message.    What do you do then? You add all these fields, that your mind’s informing you about, to your Paragraph Type.    Let’s it sum up:   add your Paragraph Type called “Call to Action”: Paragraph Types- +Add Paragraph Types add all the needed fields (link, title, image and the rest) to your “Call to Action” Paragraph Type: Manage Fields > +Add Field create a content-type landing page and a field of type Paragraph labelled “Call to Action”. Afterwards, from Settings you get to predefine which Paragraph types will be referenced   Probably one of the most alluring features of this module is that it enables you to display even far more complex components (galleries, videos, ads): you simply create a paragraph type of each one of these complex components and then give permission to the end user to reference them.   Reference Type- Reference Method: Default- Type   Note that it’s “none” that you must select from the “paragraph types” drop down menu, so that the user can reference more than just one type.   3. Decide How Your Fields Will Get Displayed There, you have your content added to your landing page and yet: don’t rush in to proudly show your “work-of-art” to your client!   There’s one more fix you still need to do: setting up the way the call to action gets displayed.   Go to Manage Display and do your thing: format and update the order in which those fields will get displayed.   Now it’s just a matter of… filling in the blanks, since all the major configuration and predefining steps have been taken.   When it comes to your landing page’s customized visuals, add CSS and override templates.   Here's An Ultra Efficient Workflow for Building Up a Landing Page 1. Gather and structure all your information and fill in the landing page content form   2. Choose a Paragraph type for each fragment of content   3. Add the elements of design that each paragraph form require   4. Mix and match, edit and rearrange the paragraph entities till you get the desired result   5. Test out the results, of course!   See? Quick and easy!   And although some might say that Paragraphs limits your creativity, in fact, it actually challenges you to be ultra efficient and, given the limited options, to get even more creative. Ironical, right?     What’s your opinion on Drupal 8 Paragraphs module? Have you been using it for building your landing pages so far?  ... Read more
Adrian Ababei / Nov 22'2016
Our Top 5 Drupal 8 Modules
The much-awaited, much talked about and supposedly innovative Drupal 8 is stil “too shiny and new” for you? Still a bit „nostalgic” about the good old, so familiar Drupal 7?    Well, don’t be! We’re going to point out to you 5 of its coolest modules which will make your life as a websites builder a lot... simpler (for, besides flexibility, simplicity has always been one of the Drupal community’s ultimate goals).   Now let’s just dive into our selection of “juicy”, highly useful, won’t-be-able-to-live-without-anymore Drupal 8 modules!   1. Views It’s by far one of the most used modules in Drupal, so no wonder that the worldwide team behind Drupal 8 strove to improve it.   Probably one of the best news regarding this module is that it’s a core module now! You do realize what this means, right? You’ll get it by default, along with the whole installing package, no need to add it yourself, manually, afterwards anymore.    And since Drupal’s all about „empowering the non-technical end-users”, you’ll be glad to hear that the Views module comes equipped with some new too-hard-to-resist-to „powers” for you:   as a content editor and site builder it enables you to filter and to display information depending on your predefined parameters: you can create a block listing the most recent posts, you get to „play with” your taxonomy listing, to put together a slideshow with the best images of the last month or a sidebar with the most recent/longest/interesting/useful comments on your website etc. as an admin, you get „spoiled” by all the „responsibilities” that the Views takes in Drupal 8: it controls content admin page, user admin page, lists, blocks and more. Moreover, you get to „work your magic” without even having to write a single line of code, just by “playing” in its admin interface: configure lists, calendar, create photo galleries etc.   2. Rules You may not be inclined to follow rules in your life outside Drupal’s world, but how about the power to set up your own rules for your website?   This contributed module allows you to create three types of rules which, put together, create a complex, logical sequence: you can set up an event (first rule), a conditioned one (second rule) in fact, which leads to a certain action (third rule).   Here’s a suggestive example for you: you’re a website’s admin, right? Well, imagine now that someone posts a comment on your site (event) and, thanks to your configured rules, you automatically get an email informing you about this posted comment (action). Got it?   The whole "attraction" for the Rules module is the fact that it enables you to create and to manage automated workflows on your website.    3. Features Now here’s another super useful contributed module that Drupal 8 „spoils” you with!   It will be extremely useful in your work especially if you have a whole portfolio of Drupal websites to juggle with (as 99% of organizations do). How precisely?   You’ll get to import/export your multiple configurations and all your code as whole packages that you can then move across your whole collection of websites.   Enlightening example: just imagine that you’ve come up with a rule (you know, we’ve just talked about that module). Ok, now the great part is yet to come: you can export it so that it can get imported to all the other websites that you might administer, simultaneously. Time-saving and efficiency-boosting, wouldn’t you agree?   4. Admin Toolbar Ok, ok, so you think that it has been improved and yet that it could have turned out much better.   Still, we can’t underestimate the role it plays in your work as a Drupal site developer: it’s menu (replacing now the old admin menu module) is now responsive. It sure fits the whole Drupal 8 „mobile-first philosophy” right?   5. Pathauto  If the whole „SEO is dead” nonsense hasn’t got to you, you’ll find this module to be so helpful.    What does it do exactly? It upgrades your website with search engines-friendly, clean URLs for your content. Of course, you’ll be lending this specific module a decisive helping hand to enable it to get your site SEO-friendly, since you’ll be the one predefining the page path patterns.    The result? Standard Drupal links turn into readable links that your visitors will love and since happy visitors means a better Google rank, you do the map!     These are our top 5 Drupal 8 modules. How does your own top 5 list look like? Is there anyone of our preferences listed there or not? Feel free to share it with us.  ... Read more
Adrian Ababei / Nov 18'2016
Here Is How You Create Drupal 8 Comments Programmatically
Since flexibility’s already one of Drupal’s emblematic features, it was about time they did something about their quite rudimentary commenting system, right? Well, get ready to embrace the upgraded Drupal 8 comments, which are far more than just some basic settings in a node type.   So, What Makes the Drupal 8 Comments far More Tempting?   1. They’re set up as fields That’s right, comments are no longer fieldable, full-featured entities. They’re still entities but set up as fields. What’s in this for you? You get to choose where exactly on the page your comments will get displayed and you’re no longer restricted to add them to content only (now they can practically “show up” anywhere the fields can)   2. Comments have their own fields Can you believe this! Not only that they’re set up as fields in Drupal 8, but you can also add a set of fields to each comment.   3. They’re of several types Now, this is just a big step ahead of the standard, one-type-only comments in Drupal 7!   For instance, now you can add comments to taxonomy terms, to users, blocks, contact messages, content and even to… other comments.   Just imagine: you’re the admin of a social networking site! You can leave private notes to your users, they, as well, can leave their own private suggestions for you, while users can also leave comments on your public-facing website, too.   Here’s another quick example of Drupal 8 commenting system’s flexibility: if you want to add comments to a content type you simply add a field “Comments” on the “Manage Fields” page and voila: there’s your comments field!   Still, when it comes to this new upgrade in Drupal’s commenting system, we must be fair and point out an issue that still needs improvement: in Drupal 8 multiple types of comments don’t come with multiple individual permissions, as well. This means that anyone who’s granted permission to post a certain type of comment can practically post any type of comment on the website.   4. Comments have their own area now  You get to scroll through the “Unapproved Comments” and the “Published Comments” lists.    5. The “Recent Comments” block is in Views  Remember how frustrating it was realizing that you could not edit your “recent comments in” D7? Things have changed now: the “recent comments” block has been moved to “Views” in Drupal 8 and is available by default.   And Here’s How You Can Create Your Comments in Drupal 8 Basically, the whole process comes down to 2 major steps:   You create a comment entity in code.   Then you save it.   Here’s how the code will/should look like:   // To create a new comment entity, we'll need `use` (import) the Comment class. use Drupal\comment\Entity\Comment;   // The function name doesn't matter. Just put the the function body where you need it. function my_modules_function_or_method() {     // First, we need to create an array of field values for the comment.   $values = [       // These values are for the entity that you're creating the comment for, not the comment itself.     'entity_type' => 'node',            // required.     'entity_id'   => 42,                // required.     'field_name'  => 'comment',         // required.       // The user id of the comment's 'author'. Use 0 for the anonymous user.     'uid' => 0,                         // required.       // These values are for the comment itself.     'comment_type' => 'comment',        // required.     'subject' => 'My Awesome Comment',  // required.     'comment_body' => $body,            // optional.       // Whether the comment is 'approved' or not.     'status' => 1,                      // optional. Defaults to 0.   ];     // This will create an actual comment entity out of our field values.   $comment = Comment::create($values);     // Last, we actually need to save the comment to the database.   $comment->save(); }   Now let’s have a closer look at each one of these fields:   entity_type: it’s the entity that you attach your comment to (a node, for instance)   entity_id: it’s the id that you’ll attach the comment to (it would have to be a nid in case it’s a node that you’ll attach it to)   field_name: this field is the one for the entity that you’re attaching your comment to   Practically, what all these 3 first fields do is let Drupal know what entity it should attach your comment to. This whole “flexibility” laid at your feet, that you get to juggle with multiple comment fields of the same entity and the fact that those comments’ fields can use multiple types of comments, themselves, is just part of the upgrades added to the commenting system.   uid: informs Drupal which user wrote a specific comment   comment_type: the type of comment you want to create (you know, who’ve already talked about how in Drupal 8 you have several types of comments to juggle with). The default comment will be just comment   subject: just like a node comes with a title field, so does a comment come with a “subject field” in Drupal 8   comment_body: is provided by default and you can remove it, just like you can remove any other one of the fields   status: if you don’t want, as admin, to be asked to approve each comment before it goes live, set it to 1   field_foodbar: although it does not show in the above example of code, we still wanted to show you that you’re free to add custom fields if you want to. Simply use the field’s machine name and give it a default value.    So, what do you think about Drupal’s new commenting system?   Do you find the improvements made to the way you can create comments to be a big step ahead, contributing to Drupal’s overall flexibility or do you consider that there are many other possible upgrades (feel free to name them) that its developers should have focused on? ... Read more
Adrian Ababei / Nov 16'2016
How to Manage Your Drupal 8 Configuration Workflow with Git: A 4-Step Guide
  Wouldn't you agree that managing configuration is vital in the life-cycle of a multi-person project? Well, its importance used to be, until recently, proportional to its main dreaded feature, that of being a major nuisance for web development teams: highly important configuration settings were missing, leading to major inconsistencies when it came to configuration handling, commits, made by the members of the team, resulting in conflicts etc.   Have no fear, Drupal 8 Configuration Management System Is Here!   That's right, Drupal's latest version comes to relieve your team of all the stress that parallel configuring actions might lead to. Upgraded with tempting configuration management tools, it allows developers to export/import all the configuration settings they will have performed to/from code.   Moreover (and this is the very best part of Drupal 8 configuration management system), Git allows the members of your team to put configuration under version control, thus keeping track of it (the ultimate goal of any configuration management endeavor, after all!).    What does this mean?    1. that you'll have a history of all configuration changes   2. that you can compare different configuration states   Setup   Do you already have a a development version Drupal 8 installed on your system? Is Drush available there, as well?    Well, before you go any further we have a "warning”/piece of advice for you:   Make sure not to put the files/folders that came with Drupal specific setup (e.g. sites/default/settings.php, sites/default/files/, sites/default/files/css/ etc.) into your repository! How to avoid that? Just make a clone of the "example.gitignore" file (that you get with Drupal) and place it in .gitignore, then adjust it  to your website's specific needs, thus keeping the files directory and setting.php unexposed to the risk of getting versioned.   Initiate The New Repository   Once you've downloaded your Drupal 8 version, simply initialize and register a new repository along with it:   $ git init   $ git add .   $ git commit -m "Initial Commit: Drupal 8.x Code base"     Great! Now consider this: Drupal 8 configuration management system only works on distinct instances of the same website! So, what solution do you have? You simply clone it: import the database of the website to be cloned in the other environment!   Next,  add your remote repository clone URL:    $ git remote add origin REMOTE_CLONE_URL   Push the commit up to GitHub:    $ git push -u origin master     ... and voila: you have your new functional Drupal 8 website!     Now let's start “playing” with the Configuration Management System that Drupal 8's developers "spoil" us with, easing our work by giving us full control over all the changes we (along with out teammates) will apply to our site later on during its development process!   Go ahead and export your configuration   After you've set up the needed configuration, it's time to export it. How? Use the command line for exporting the site configuration to a new folder (config/site):    $ mkdir config   $ drush config-export --destination=config/site   Next, commit and push the configuration to the repository.   There, you've just created your own "safe", the one that stores priceless website information!   Practically, you now have a valuable screenshot of how your website looked like when you installed it. From now on, dare and perform any configuration you'd like, knowing that at any time you can just roll back your site to precisely this state: the one right after its installation!      Time To Import Your Configuration   For importing your configuration from the config/site, rely on this "powerful" command:   # Import the configuration from the repository   $ drush config-import --source=config/site     Why powerful? Because it instantly overwrites the current configuration!      It's after you've exported your configuration that you can merge it with those of other members of your web development team:   add and commit the configuration to Git use Git pull, then focus on fixing any commits conflicts that might arise   At this point, we have another warning/helpful piece of advice for you: don't rely exclusively on Git for the configuration's merging part. Be sure to check whether the result of the merge is correct, whether it makes sense!     If everything will have gone smoothly with your configuration's importing process, you can go ahead and push it to the remote repository.      Valuable Pieces of Advice   1. Always export configuration first and pull the configuration changes run by your collaborators secondly! Why? Because Git doesn't recognize the changes will have have applied to your database until you actually export them!   2. Always import first, push secondly! This means that it's always safe to import the configuration and only then to push it to the remote repository, avoiding the risk of breaking the site (in case you're dealing with a broken configuration)   3. Accompany each import with a database dump, thus granting your team a backup in case anything goes wrong   4. Deal with this thought: you can't rely on Git for everything! Don't loosen your vigilance, especially when you're a member of a larger team working on the same project! ... Read more
Adrian Ababei / Nov 14'2016