Upgrade Your Drupal Skills

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

See Advanced Courses NAH, I know Enough
Aug 26 2021
Aug 26

On our theme BizReview and Listiry, now available in Drupal 9, we have to solve the common problem with displaying nodes on maps.

Here are what we have used in our themes and have verified it is working. Please see the result as below:

Demo of maps on Drupal

Now please follow our tutorial on how to display maps on Drupal with Geofield, Address and Geocoder modules:

1. Install Drupal and Geofield

Install Drupal core:

composer create-project drupal/recommended-project my_site_name_dir

cd my_site_name_dir

Install geofield and geofield_map

composer require drupal/geofield drupal/geofield_map

Enable them all.

2. Create content types and fields

Now please create a new content type, "Listing" for example, and add a new field of type Geofield.

Go to Manage form display, and set the geofield's widget to Geofield Map

Set Geofield's manage form display to Geofield Map

Go to Manage display, and set the geofield's display to Geofield Google Map

Now you can create a testing node, enter the latitude and longitude as below:

Lat: 40.703081
Long: -73.935658

Save it and you can view the newly created node like this.

Demo of maps on a Drupal node

3. Autocomplete address:

As you can see, we can't just enter coordinates data (latitudes and longitudes) everytime we create nodes. How can we know the coordinates of an address?

The user friendly solution is when we type an address, it will automatically translate it to coordinates.

And that's when we need to use Google Place APIs in order to achieve that.

You need to register a free Google APIs key, please follow the guide here: https://developers.google.com/maps/gmp-get-started#enable-api-sdk

Enable Place APIs on Google Maps APIs

Note: you need to enable Geocoding, Maps and Place APIs on your Google Cloud Console.

When you enter a valid key at /admin/config/system/geofield_map_settings, please go to Manage form display and enable Address Geocoding of geofield.

enable Address Geocoding of geofield

Then you can start to enter addresses and they will be converted to coordinates automatically.

Address autocomplete on Drupal

The address info you type in, is only shown on the node edit form. So if you want to store it to display on the node page, please do the following:

Create a new field of type plain text, field_geoaddress for example.

On Manage form display, edit the setting of geofield, and set Geoaddress Field to field_geoaddress, select the option to hide it from the node form.

Set geoaddress for Geofield

The new field_geoaddress will keep the address you type in, so you can display it as you wish.

4. A complete Address field

If you want a complete address field with Street, Neigbour, City, State, Country fields ... you will need the Address module.

Install and enable Address module:

composer require drupal/address

Now create a new field of type Address on your content type. Then you can add complete address info on your nodes.

Address module on Drupal

5. Address to Geofield:

How can we automatically convert the address field to coordinates on Geofield? We need Geocoder:

Install the module:

composer require drupal/geocoder

Install Google Maps and Arcgis PHP package:

composer require geocoder-php/google-maps-provider geocoder-php/arcgis-online-provider

Tip: the "geocoder-php/arcgis-online-provider" is free (no API Key required), it is a good testing provider.
"geocoder-php/google-maps-provider" is good if you have an API key.

Enable all modules and submodules.

Config provider: /admin/config/system/geocoder/geocoder-provider, please add Google Maps and Arcgis Online Provider as the providers.

Config Geocoder providers

After that, please go to Manage fields, edit the geofield node and set it to geocode from the existing address field.

Config Geocoder for Geofield

When you are done with it, everytime you create a node with address info, Geocoder will automatically convert it to coordinates so it can be displayed on maps.

Have fun!

May 13 2021
May 13

Reason #1: You Get Two Robust Systems In One.

Most e-commerce sites include integration with third-party content management systems. These may have many inconsistencies and quirks, requiring site owners to spend precious time integrating two systems. And if they achieve a satisfactory result, they would have to maintain the two systems separately: upgrade them, back them up, and correct security problems, and so on. It doubles the amount of time and effort required.

Drupal 8/9 helps you manage content by changing product descriptions, writing blog posts, creating landing pages, and doing other content marketing tasks. On the other hand, Drupal Commerce handles all e-commerce, including book and order management, payment processing, tax estimates, and so on.

You can also easily link your product descriptions from other parts of your website, such as a landing page or blog. The better your search engine visibility, the higher your website will rank and thus attract more traffic.

Reason #2: You Get An Accessible Website.

Accessibility is critical for all websites, but it is especially essential for e-commerce sites. An online store that fails to consider the needs of people with disabilities gets doomed from the start. Legal issues, sales loss, and being penalized by search engines are just a couple of the reasons to take accessibility seriously.

When you develop an e-commerce website in Drupal 8 and Drupal 9, you get accessibility to many Drupal 8 features out of the box. Some of these features are all image alt tags must-have details, and all Drupal 8/9 themes have a contrast ratio appropriate for visitors with low vision.

Reason #3: You Can Create An E-commerce Website In Multiple Languages With Drupal 8/9.

As previously said, one of the most significant benefits of e-commerce is the ability to conduct business across borders. Host your online store on a server and make it accessible to people all over the world, regardless of distance or time. You can also make your content accessible to customers in different countries in appropriate regional languages. It will increase confidence and traffic to your store.

Also Read: Drupal 8 Module Development: A Compressive Step-By-Step Guide

When you build an e-commerce website in Drupal 8/9 or Drupal Commerce, you save a lot of time and effort in localization. If you want to create multilingual ecommerce websites, Drupal is most likely the best tool. It provides you with access to several language-related core modules without much effort.

The Interface Translation module, for example, allows you to easily translate your store's UI, while the Content Translation module does the same for your content. All you have to do is properly configure them.

drupal for website development

Reason #4: Mobile Ready.

If your e-commerce site performs well on mobile devices, it will perform well on other devices as well! Creating user scenarios will assist you in determining what type of content the user will enjoy on their mobile device. This method will assist you in designing the essential elements for your website.

Mobile compatibility has evolved into an essential function for every eCommerce platform. All in today's world must be mobile-ready. Drupal websites not only impress clients with their appearance but also with their mobile responsive design. Drupal websites are simple to use on mobile devices and tablets.

Reason #5: Multilingual.

The internet has taken over the world, and with so many people using similar channels and so many brands spreading internationally, multilingual websites are a must! Even though most internet users choose English as their primary language, ten other languages account for 90 percent of the top ten million websites. Meaning, you need a website in multiple languages to thrive and grow in this highly competitive world.

Drupal is the best platform for a multilingual website. It offers many languages to choose from and four main modules explicitly designed for language and translation support. This Drupal function has yielded excellent results, including increased conversions, improved SEO, unrivalled translation workflows, and a significant contribution to audience expansion. It can also detect the user's favourite language by defining the user's IP address, sessions, browser settings, and so on.

Reason #6: A Quick Website That Is Simple To Extend And Scale.

An excellent online store eventually "grows out of its clothing" and must scale to meet increased traffic. It is essential to add new features. Scalability is not an issue when building an e-commerce website with Drupal 8/9.

First, both the CMS and Drupal Commerce have an extensive range of core and contributed modules that can handle nearly any task imaginable, from creating custom forms to dealing with currencies and calculating discounts.

If this isn't enough, we can further expand the systems by using different application programming interfaces or APIs for short. Drupal websites may use this to access a wide range of external resources, from social media to shipment monitoring.

Drupal REST API has also separated the backend and frontend, and developers can now use any technology to create UIs for Drupal-based websites, including the common JavaScript frameworks Vue.js, React.js, and Angular.js. As a result, websites are much quicker than they used to be. Speed is a decisive conversion-increasing factor. Nobody wants to stay on a page more than a few seconds for a website to load.

Furthermore, the REST API has broadened the channels by which consumers can access an online store. Visitors use the same database when using a smartphone, tablet, desktop, Mac, or PC. It allows you to reach a much larger audience and therefore generate even more sales.

Drupal Website

Reason #7: You Get A Website That No Hacker Can Exploit.

Due to the rise of ecommerce stores, hackers are also using advanced technology to hack ecommerce websites. Cybersecurity is especially important for e-commerce stores as it holds a large amount of customer data, payment details and more. A data breach can result in various issues, including consumer financial information falling into the wrong hands.

Also Read: Web Development Strategy You Must Follow for a Successful Drupal 9 Upgrade

If you are using Drupal 8/9 and Drupal Commerce to create an e-commerce website, you are well-protected against any security threats. The Drupal 8/9 software package is a model of protection in and of itself. There is also a dedicated community of Drupal experts devoted to ensuring the system's and modules' absolute security.

When a new security patch is released, site owners may immediately begin using it. Scammers do not have the reason to create havoc.

May 06 2021
May 06
Quick Tabs Module to add tabbed content in Drupal

The Quick Tabs Module

is handy when there is a need to add tabbed content and the possibility to switch between content displayed on your web page.

This blog post is  entirely devoted to the Quick Tabs Module, how to add tabbed content and what benefits you will get from creating tabbed content on your Drupal website. The Drupal support team does not guarantee that you will become a professional after reading the blog, but you will definitely get the basics.

Apr 28 2021
Apr 28

Compatibility

Before you download a module in Drupal 8, make sure it will be compatible with your Drupal 8 version. You cannot install a Drupal 7 module into Drupal 8 installation if it is not supported. In Drupal.org, to know the module version released by Drupal.org, navigate to the module's page and scroll right to the end.

Actively Maintained Modules

You need to check and verify that the modules you have chosen are actively maintained, updated, and published by the developers. Suppose you encounter any security vulnerabilities or any other issues while developing.

You will get an instant response from the developer/contributor. In Drupal.org, to know the module version released by Drupal.org, navigate to the module's project page and scroll right to the end.

Popularity

Make sure to choose popular modules to do the job, as you will get more minor issues while developing. To check this, go to the module's project page on drupal.org. Here, you will see the number of downloads and the number of websites currently using that particular module.

Now that you have chosen the module for development let's get started. In Drupal 8, the modules folder hosted in the root directory of Drupal 8 is where you will find the contributed or custom modules.

Things You Should Know Before Beginning Drupal 8 Module Development

Apr 27 2021
Apr 27

Now that you have enough reasons to migrate to Drupal 8 or 9 from Drupal 7. We have listed out ten essential things that you should remember before you begin the Drupal 7 to 8 migration:

Migrate from drupal 7 to drupal 9

1. Observe and Plan

For a smooth Drupal content migration, first Identify the content types and structure of the existing site and note down the observations. Note down the field types, blocks, content types, taxonomies, etc.

Note down what you need to migrate and what you need to merge based on these observations. Check the Views and other site configurations and note them to replicate them in Drupal 8.

2. Create a checklist of Drupal 7 website modules

First, identify modules that you still need, or if the Drupal 7 module has moved to Drupal 8 Core. keep in mind that not every Drupal 7 module is automatically migrated to Drupal 8. Some of the Drupal 7 modules may have put their functionality into a single Drupal 8 module, and some may have separated their features into two or more Drupal 8 modules.

3. Update to the latest available version

Update your Drupal 7 to the latest available version of Drupal 8 or 9. It will ensure cleaner automatic upgrades of Drupal 7 modules with direct Drupal 8 or 9 upgrade paths.

4. Access.

Before migration, make sure you can access the Drupal 7 website's database and files - both public and private.

5. Backup your website

Before you start the Drupal 7 migration process, make sure to create a backup of the Drupal 7 website and use it for the Drupal 8 migration. Although the Drupal migration does not modify the source, It is still not good to migrate a live functional website.

6. Download a fresh installation

Download a fresh installation of Drupal 8 and again, remember, it MUST be FRESH! If you have done configurations or created content, it will be overwritten automatically when a Drupal 8 upgrade is performed.

7. Familiarize yourself

Unlike in previous version upgrades, you cannot perform a direct upgrade from Drupal 7 to Drupal 8. Drupal 8 Migrate module, Drupal 8 Migrate Drupal module and Drupal 8 Migrate Drupal UI module are three modules in Drupal core. You need to familiarize yourself with Drupal 8's migration system and configuration.

8. Decide the choice of migration

Drush (which gives you granular control) browser user interface (more accessible but less control) are two of the choices you have. You can opt for the method that suits your familiarity level and experience.

9. Know your source

The flexibility of the Drupal content migration system allows you to extract content and load from older versions of Drupal and other sources like CSV, XML, JSON, MYSQL, etc.

10. Perform a content audit

Perform a thorough content audit on the Drupal 7 version to identify content you need to migrate to Drupal 8 or 9. For a smooth Drupal content migration, remove the unused and irrelevant content to avoid spending time and effort migrating them.

Also Read: Custom Drupal Development: 10 Things You 'Must' Know For Best Output

Apr 26 2021
Apr 26

Drupal 7 is generally not quite the same as Drupal 8 and Drupal 9. Many structural changes that progress from a Drupal 7 website to a Drupal 8 are more like a relocation project from an unexpected CMS than a product redesign. For instance, the brand new theme and PHP library in Drupal 9 are features that attract most of the Drupal CMS owners.

Drupal Website Development

Fortunately, there is no large building hole between both Drupal 8 and Drupal 9.

Drupal 9 in reality, more like a next minor center overhaul like 8.8 to 8.9 with some newly added features. Remember when you upgraded Drupal 7 to Drupal 8 that led you to rewrite the Drupal from scratch? Don't be scared; Drupal 9 offers the easiest upgrade from Drupal 8. Since Drupal 8 is backward compatible, you will not have to write custom codes after upgrading. If you practice removing the old and deprecated code base, upgrading from Drupal 8 to Drupal 9 will be smooth as butter.

If you are still using Drupal 7, it will reach the end of life by November 2021. To avoid it, you can upgrade your Drupal website to Drupal 8 or Drupal 9. To help you do a smooth upgrade, here is a comparison guide for Drupal 7 Vs. Drupal 8 Vs. Drupal 9.

Drupal Features

Apr 23 2021
Apr 23

Drupal 8 is loaded with several built-in languages ​​to save time and effort for users using Symphony, which has an underlying element called translation, which can create multilingual sites and help you show the site content in multiple languages. Using Symphony, you can translate everything from content to blocks to menus to taxonomy. You can even translate user profiles, image styles, views, text formats, comments, and feeds on your website. In short, Drupal 8 provides the entire site translation.

Apr 22 2021
Apr 22

Custom drupal development methods vary from version to version in Drupal. The one method used in Drupal 7 might not work for Drupal 8. Here are some of the crucial things to keep in mind for the best output of custom Drupal development:

1. Use Configuration Before Code

To avoid hard-coding a class into a theme, make sure to set the values in the configuration and use it with the code to avoid rewriting the code every time you have to make changes. Once you set the value in the configuration, it gives you advanced functionality and "easy to modify" features. It also enhances coding speed and results in high-quality modules.

2. Limit The Usage Of Modules

While working on enterprise-level Drupal websites, it is essential to use fewer modules. Avoid using every single module which is lacking. Experienced developers are in favor of programming their modules rather than reusing the existing ones. A higher number of custom modules will demand more work in the future to maintain and modify your Drupal site. Publish your modules on Github, which helps you avoid using a larger number of custom modules and encourages you to create reusable code with the required configuration.

3. Environment & Coding Standards

Most of the Drupal development companies work in the same development environment to ensure efficient workflow. In such scenarios, the biggest issue is to make sure that the produced code is clean and reliable; the code should make sense to their team members and the larger Drupal community itself. With the Drupal community and distributed teams working together efficiently, you need to follow coding standards to make sure you achieve the project's goals and objectives.

4. Use hook_schema and hook_update_N

Your module will need its database tables if it stores data in the database which is not Drupal entities or nodes, and you are going to use it as content. Make sure to declare the table schema you will need. You can use "hook_schema" in the module. install file. It will be created and removed on its own whenever you install or uninstall a module.

If you want to remove, add or modify columns or modify the schema, you can easily do these changes in an update hook. Use hook_update_N and bump the version number. Other developers or development teams can implement these changes by pulling your code by running "drush updb."

5.Use what Drupal offers

Drupal has several built-in and admin functionality to help you store and display your module's data. You can define the module settings pages using hook_menu; it will enable modules to register paths to help determine how URL requests are handled. You can use the drupal_get_form page callback to define and return the settings that are needed to be stored. One of the key benefits of doing this- you can restrict, submit and validate handlers to the form if the value has to be integers or existing data fetched from an API, etc.

6. Working With Cron

Cron is a time-based task scheduler that you can configure to execute tasks automatically without any manual involvement once the initial configuration is done. Drupal offers several built-in cron functionalities and a task queue for almost every module development. However, in some cases, like your hosting provider doesn't support cron tasks configuration or maybe you are facing issues in configuring it to run correctly, it is essential to check your site's status report to figure out if you can use Cron configuration.

7. Have A Dedicated Place For Your Custom Modules

Suppose you have named your Drupal custom module as "My_shop." In this case, call the new dedicated folder as "/module/custom/My_shop." It's always advised to create a proper place for this type of module so you don't have to struggle a lot when you want to use the new custom module. It also helps you keep the in-built Drupal module downloaded by Drpal.org and custom modules separated from each other.

8. Create A New Module If Necessary

Reuse the existing Drupal modules as much as possible instead of jumping to write one from scratch because the heavy "load" of custom modules can become challenging to maintain and update your Drupal website in the future.

9. Debug Your Module With Xdebug

It is also known as the golden rule to follow when developing custom modules in Drupal. Debugging your custom module code ensures that there are no PHP code bottlenecks, and you're using only the latest code.

10. Use Automated Code Checking Tool

Make sure to use automated code checking tools like Coder to ensure that your code is reliable, clean, readable, and adheres to Drupal’s coding standards. It also helps you ensure that you are following the best practices of your PHP version.

Apr 21 2021
Apr 21

Pros of Choosing WordPress Over Drupal For Website Development:

Ease Of Use – WordPress is a free and open-source CMS in which anyone can change and redistribute its source code. WordPress even offers mobile apps that make content editing, site administration easy on any device.

SEO-Friendly – Sites built using WordPress are SEO-friendly as there are several SEO plugins (such as Yoast SEO) inbuilt to help optimize content, meta tags, keywords, etc.

Responsive – You can use thousands of WordPress themes to make your site responsive and mobile-friendly. Using this market-leading CMS keeps you ready for the emergent responsive web technology.

Cost-Effective – WordPress is free, and even its paid features are less expensive than Drupal. The development, maintenance, and hosting cost of WordPress is lower than Drupal.

E-Commerce – WordPress provides plugins like WooCommerce to help you run your e-commerce site efficiently. Also, it has the features to help you handle the growing demand for your products and services.

Cons of Choosing WordPress Over Drupal For Website Development:

Frequent Updates – WordPress releases regular updates, and if you fail to keep up with these updates, it can bring your site to a screeching halt.

Customization Sophistication – You need to know PHP, CSS, and HTML to write complicated code if you want to add any enhanced feature to your site and

Pros of Choosing Drupal Over WordPress For Website Development:

Rapid Development – Drupal is agile and rapid, which helps developers create and deploy a website's core features and functionality. You can use the modules to cut down development times from weeks to days.

Extensive API Support – Drupal offers a range of API support, including Google Analytics, Facebook, Twitter, Google Apps, YouTube, that help developers create custom modules effortlessly.

Security – Unlike WordPress, themes, and modules are covered by an internal security program in Drupal. Therefore, it is not vulnerable when third-party plugins are uploaded as it is challenging to smuggle malicious content in Drupal.

Cross-Browser Usability and Support – Drupal is easy and suitable to use with almost all major browsers. The website's functionality and design translate as per the browsers.

Access Controls / User Permissions - Drupal has a built-in access control system using which you can easily create new roles with individual permissions in no time.

Cons Of Choosing Drupal Over WordPress For Website Development:

Installation and Modification – Drupal does not offer ease of use as WordPress because of its script, which is not user-friendly and needs advanced technical knowledge to install and modify.

Compatibility – Drupal is not backward compatible; if you have extra content and programs in place that you are customary to, Drupal might not be the right CMS platform for you.

We hope you have sound learning of both, WordPress and Drupal CMS platform’s pros and cons now. Again the choice of the right CMS platform for your business boils down to the question; what is your business requirement?

Apr 15 2021
Apr 15
Prevent Website Spam

Spam.

This word contains so much pain and headache for any site owner. It is not possible to 100% eradicate spam from your website. However, it is possible to reduce these rates to a minimum, provided that you know how to prevent website spam.

Today we are going to tell you about the best ways to stop website spam. Our web maintenance company has chosen 6 handy anti-spam Drupal modules. You have to choose the one that suits you best and add it to the site.

Mar 26 2021
Mar 26
Protect Drupal web forms from new malware injection methods

We all know that malware can come from everywhere — but now that includes web forms.

Hackers have come up with a new malware injection method to distribute malware through web forms on your Drupal website.

Today Drupal web developers from Drudesk will show you how to resist this and protect your Drupal web forms from new malware injection methods. Read this blog if keeping your site safe is important to you.

Mar 11 2021
Mar 11
Choose Drupal 8 for your eCommerce website

Ecommerce sites are booming today, in part due to Covid.

For your business to succeed, it is important that the platform on which you build your website is scalable, reliable, secure, and flexible. Given this, Drupal 8 is the best option for building an eCommerce site today.

Feb 10 2021
Feb 10
Drupal 8 to 9 Migration

2020 was significant for web development — not just because of Сovid, but also because of the new version Drupal 9.

Since the new version was based on the same core as the previous one, the developers promise that the Drupal 8 to Drupal 9 migration will be smooth and fast.

Drudesk, our web support agency, has put together a guide for you on the migration preparation process from Drupal 8 to Drupal 9 to understand all the details and conditions.

Jan 07 2021
Jan 07

Since last June 2020, we heard a lot about Drupal 9. And you may wonder, should we do the update to Drupal 9?

Depending on you current infrastructure, the consequences won't be the same. That's why, our experts wanted to do this infography in order to give you some insights about you next Drupal project.

A project? A question? Don't hesitate to contact us: https://www.smile.eu/en/contact

Infography Drupal 9

Dec 16 2020
Dec 16
Drupal modules to increase site performance

Do you want your site to be the first in the search results, make users feel comfortable using it, and get a high conversion rate? Just make it as fast as possible!

Your website's speed is essential because, if the website is fast, users will visit it more often. Statistics say that if a user waits for 3 seconds and more, they will leave the website and never return. The most comfortable loading time for users is 2 seconds. You may ask:

Why do I need to improve the performance of the site?

It influences your Google ranking!

Nov 18 2020
Nov 18
Generates a username automatically in Drupal site

First of all, generating a username automatically in your Drupal site is very useful for the site admins and website visitors.

Let's start with the fact that today, to use the services of the site, users have to log in.

As a rule, registration includes filling in the following data:

Oct 21 2020
Oct 21
Image Effects on the Drupal 8 website

Drupal 8 has already proven its versatility. Its core already has modules for working with images, but installing additional modules will not hurt (for example, the Image effects module).

If you stop using just your Drupal site's standard features, there is no question that your site will increase in convenience, attractiveness, and victory over your competitors!

Our Drupal support agency has created today's blog to expand your site's horizons and introduce you to the main features of the Image effects module. Enjoy your reading!

Sep 30 2020
Sep 30
Drupal 8/9 modules for intuitive website navigation

Good website navigation is the best way to provide an enjoyable user experience.

To create intuitive website navigation on Drupal 8 or 9, you should use the appropriate website navigation modules.

As we have already mentioned in our previous blogs, if you want users to be comfortable using your site and find all the information they need, you should develop website navigation that would be easy for children to use.

Aug 19 2020
Aug 19

When a new product rolls out, it raises a lot of interest. The Drupal 9 release is no exception. This interest is easy to understand because new versions of Drupal bring new digital opportunities. Today, interactions with potential customers have shifted into the virtual sphere, so websites have an especially important mission to perform.

Whenever you have questions, our Drupal development team is ready to provide the answers! We offered you a Drupal 9 upgrade checklist for website owners, and now that Drupal 9 is out, it’s time to take a new look at it and answer all your questions in our Q&A session.

Drupal 9 release: Top Questions and Expert Insights

Question: What was the release date of Drupal 9?

Answer: Drupal 9.0.0 was released on June 4, 2020.

Question: What are the new features of Drupal 9?

Answer: The Drupal 9.0 release is not game-changing in terms of features. It is very similar to Drupal 8.9, but cleaned-up from obsolete code and furnished with the latest versions of third-party dependencies. One of Drupal 9’s outstanding capacities is super easy upgrades.

When it comes to features, from Drupal 8.0 all the way to Drupal 9.0, Drupal has been growing and evolving in many aspects. This will continue in Drupal 9. It is significantly easier to use for marketers, content editors and designers. New Media and Media Library, Layout Builder, Content Moderation and Workflows, and Workspaces have transformed the editing processes forever. Drupal’s API-first nature with JSON: API in the core makes websites more open to third-party integration and multi-channel reach.

Layout Builder in Drupal 8 and 9

The Drupal creators will keep inventing more interesting features based on the strategic tracks — better editor-friendliness, compliance with website accessibility standards, integration, and more. For example, the new default front-end theme Olivero planned for Drupal 9.1 ships with the best web accessibility practices included. And it’s just the beginning of Drupal 9’s forward movement.

Question: What are the updated dependencies in Drupal 9?

Answer: Among the major third-party libraries and components in Drupal 9 are the template-making engine Twig 2, useful components of the high-level framework Symfony 4.4 (with Symfony 5 in plans), the modern content editor CKEditor 5 in plans, and many more.

Question: What are the benefits of the updated dependencies in Drupal 9?

Answer: Modern versions of dependencies make websites faster, more efficient, and more secure. Their code gets much cleaner, which leads to easier website maintenance, more efficient development, friendliness to search engines, and so on.

Question: What are the reasons to upgrade to Drupal 9 from Drupal 7?

Answer: Drupal 7 is getting outdated in its digital capabilities. Between Drupal 7 and Drupal 8/9, there is a technological abyss, but you can cross the bridge to the other side.

You will get a version with all features of both Drupal 8 and Drupal 9. Multilingual options, third-party integrations, mobile-friendliness, better accessibility, outstanding changes for content editors, and improved configuration management are just a few examples.

Question: What are the reasons to upgrade to Drupal 9 from Drupal 8?

Answer: Drupal 9 has huge plans for innovative development. In addition, an upgrade from D8 to D9 is very easy and requires actions you need to take anyway.

To move from Drupal 8 to Drupal 9, you will need to clean up the deprecated code from your site and update it to the latest minor version of Drupal 8. You need these updates in any case to use all the new features that have appeared from Drupal 8.0 to Drupal 9.0, as well as to get more security for your website.

So the question “Why upgrade to Drupal 9 from Drupal 8?” need no extra explanation — this is just your simple, natural, and effortless move to the future.

Question: How do I prepare for Drupal 9?

Answer: The key requirements are to update your website to Drupal 8.8 or 8.9, update your modules and themes, check your site for deprecated APIs and functions and replace them with new alternatives, and make sure your hosting server uses PHP 7.3 or higher. Some of the useful tools to prepare for Drupal 9 are the Drupal Check command-line tool, the Upgrade Status module, the Drupal-rector tool, the Upgrade Rector contributed module, and the Drupal 9 Deprecation Status page.

Drupal 9 readiness module status page

Question: How long will it take to upgrade from Drupal 8 to Drupal 9?

Answer: A well-prepared site makes the upgrade instant, so the answer depends on the state of your website’s readiness. This includes how long ago you made updates between the minor versions (maybe you are still on 8.1 or something), how many custom modules you have that need to be cleaned up from obsolete code, and so on.

Upgrade to Drupal 9 with us!

The above questions about the Drupal 9 release are the most commonly asked, but our Drupal team will be glad to answer any of your questions. Of course, we will seamlessly upgrade you so you can enjoy the latest Drupal version. Our prices are affordable and a quote is free. Contact us for a new digital era of your website!

Jul 16 2020
Jul 16

Drupal 7 to Drupal 8/9 migration is something that should bring a great value to your business. Numerous Drupal 8 improvements and the fully revamped architecture impressed everyone when the 8th version was released.

Since then, Drupal 8 kept rapidly improving with better admin usability, performance, accessibility, third-party integration, multi-language, and other most modern web practices. The 9th version arrived as an even cleaner version, boasting instant upgrades from D8, equipped with modern libraries to make sites faster, and with plenty of ambitious plans for future innovation.

You might be already tempted to migrate from Drupal 7 to Drupal 8 or 9, but there is something stopping you. You may ask yourself: how much time does it take and how much does it cost to migrate from Drupal 7 to Drupal 8/9?

This question will be answered on a case-by-case basis, but we will do our best to give you the estimated time and cost of Drupal 7 to Drupal 8/9 migration in this post.

Getting ready for your Drupal 7 to Drupal 8/9 migration

Migration is always a great chance to refresh or revamp your website in many ways. To make sure the upgrade brings you the best value, as well as help the development team give you more precise estimates of Drupal 7 to Drupal 8/9 migration, you will need to do a little preparation.

Rethink your business goals: what new priorities have appeared and how would you like your website to reflect them? And, vice versa, what is no longer relevant and should be cleaned up? Talk to your admins and content editors: what functionality is missing and what could be improved in order to speed up their routine tasks?

Based on this, developers will help you review your website’s modules, configuration, UX design, and more. Some things will “travel” to the next level, some things will be replaced by more modern alternatives, some things will be cleaned-up, and so on.

How much time does it take to upgrade from Drupal 7 to Drupal 8/9?

The simplest of brochure sites without custom modules and with just a couple of content types can be migrated within 30 hours. However, as the site complexity grows, the migration process extends. For some websites, it can take a couple of months. The larger, the more complex, and the more custom-heavy your site is, the longer it will take to migrate. Let’s see how it works.

  • Initialization. The essence of every Drupal 7 to Drupal 8/9 migration is to move your website’s configuration and content to the newly created clean site instance. Content includes blog posts, images, files, and similar elements, while configuration is about your content types, fields, views, comment types, and so on. Developers analyze all this and decide on the migration specifics. They also prepare a fresh Drupal destination site, update your source site to the latest minor version, enable the necessary modules, etc.
  • Custom module rewriting. An important point is that your website’s custom logic in the form of custom modules will need to be rewritten according to the Drupal 8/9 standards (object-oriented programming, or OOP). This might take up a lot of the migration time.
  • Automated or manual migration process. Thanks to the migration pack of modules, it’s possible to automate many standard processes. However, in many cases, manual recreation of elements (e.g. views) is also needed. To import the website’s data in various formats (XML, CSV, RSS, etc.), developers will need to define the source and the destination. Some projects require complex field mapping, which influences the time. If you need to reorganize the content structure, it will take more time as well.
  • Validation. When the data has been migrated, developers carefully check that there are no errors and that the fields have been correctly filled with the data.
  • Website launch. When everything is thoroughly checked, developers deploy your new and shiny Drupal 8 or 9 website to live.

That said, the number of hours it takes to migrate increases when:

  • You have many custom modules.
  • Your website has a lot of content types and content.
  • Your content types need to be reorganized (split, consolidated, etc.)
  • Your content is multilingual.
  • There are custom fields on your site.
  • There is a need to recreate many views.
  • You need a website redesign.
  • And so on.

It should be noted that, even in the most complex projects, the time of Drupal 7 to Drupal 8/9 migration can always be reduced if you wish. To achieve this, you can hire a larger number of developers to perform the migration.

How much does it cost to upgrade from Drupal 7 to Drupal 8/9?

The cost of the Drupal 7 to Drupal 8/9 migration will depend upon the time and the hourly rate. The hourly rates may differ across companies. InternetDevels, together with our support team Drudesk that specializes in migrations, charges $30 per hour on average.

So, if a simple brochure site takes 30 hours to upgrade from Drupal 7 to Drupal 8 or 9, the cost starts at $900. This looks very lucrative, doesn’t it?

Upgrade from Drupal 7 to Drupal 8 or 9!

Show your website to our Drupal migration and upgrade experts team to discover the exact time and cost of your Drupal 7 to Drupal 8/9 migration. Our high-efficiency approach will allow you to save a lot of hours and budget. We also offer something totally free — our consultation and our attention. Contact us!

Feb 28 2020
Feb 28
  • Core Modules: These modules are installed in all the Drupal installation packages; you can say that they are the basic (core) modules necessary for the site designing task, like handling the accounts of the users, providing menus for navigation.
  • Contributed Modules: This module can be downloaded from the official Drupal.org site.
  • Custom Modules: Custom modules are pretty self-explanatory – they’re explicitly coded for individual projects.

So here, we try to list out some of the modules from a Pandora of modules that can be used on the go for your web development, in a hassle-free way.

Read More - Move on to Drupal 8, Be Ready for Drupal 9!

Jan 20 2020
Jan 20

In this tutorial I will explain how I accomplished taking a listing of nodes that came from a View and created a Parallax effect using the Bootstrap theme from Drupal 8.

The code in this tutorial can be found on GitLab. 

To use the code in the repos, you can:

  1. Clone the repos locally
  2. Run composer install from the root folder
  3. Run drush config:import -y 

I would like to refer to this article which explains how to Add Parallax Blocks to Drupal 8 With ScrollMagic. I got my ideas and most of the code from there.

You will need to have Drupal 8 installed with Views and a Bootstrap subtheme set up.

For this tutorial, I am using a simple Page content type that I created with 3 fields: Title, Body and Background Image.

You should then create a View that lists this Page content type. I am listing the Body field and Background Image field in my example. I am keeping my Page content type and View very simple for explanation purposes. But you can set up more complex Views and content types as you wish. You just need at least an image field (or you can place a background image to an existing content type field via CSS as well).

Step #1 - Configure the Bootstrap theme

Because Parallax effects are usually full width, you should turn on the Fluid container option in the Bootstrap theme menu.

  • Enter your subtheme Boothstrap theme settings.
  • Under General >> Container check the Fluid container boxFluid checkbox

Step #2 - Set up your Content Type and Views.

Here is my Page content type with 3 fields: Title (not show in in screenshot), Body and Background image

Page content type fields

Here is my View. It's a pretty much standard View which just lists the Page content type and creates a page out of it. I am using the image field here as the background image for the Parallax. You can also use another field (text or whatever) and set a CSS background as the image.

View listing page content types

Now create some Page content and go to the View page to see the listing of your content.

Step #3 - Style the View using CSS

Here is my CSS:

.view-homepage {

  .views-row { text-align: center; position: relative; overflow: hidden; height: 500px; }

  .views-field-field-background-image { position: absolute; width: 100%; height: 140%; }

  .views-field-body {

    position: relative; top: 50%;
    -webkit-transform: translateY(-50%);
    -ms-transform: translateY(-50%);
    transform: translateY(-50%);
    color: #fff;
  }
}

Step #4 - Get the ScrollMagic files

Go to Github and download/extract library.

Now go to your theme folder and create a folder called /js/ and move these files into the folder

  • animation.gsap.min.js
  • ScrollMagic.min.js
  • TweenMax.min.js
  • and also manually create a blank parallax.js

You now need to tell the theme to load the js libraries. To do that, open your_theme/your_theme.libraries.yml:

global-styling:
  css:
    theme:
     css/style.css: {}

  js:
    js/ScrollMagic.min.js: {}
    js/animation.gsap.min.js: {}
    js/TweenMax.min.js: {}
    js/parallax.js: {}
  dependencies:
    - core/drupal
    - core/jquery

Step #5 Add the Parallax JS code to parallax.js

(function ($) {
    'use strict';
    Drupal.behaviors.myBehavior = {
        attach: function (context, settings) {

            var controller = new ScrollMagic.Controller();

            $('.views-row').each(function (index) {

                var $bg = $(this).find('.views-field-field-background-image');
                var $content = $(this).find('.views-field-body');

                var tl = new TimelineMax();
                tl
                    .from($bg, 2, {y: '-40%', ease: Power0.easeNone}, 0)
                    .from($content, 1, {autoAlpha: 0, ease: Power0.easeNone}, 0.4)
                ;

                var scene = new ScrollMagic.Scene({
                    triggerElement: this,
                    triggerHook: 1,
                    duration: "100%"
                })
                .setTween(tl)
                .addTo(controller);
            });
        }
    }
}(jQuery));

Make sure the images you are using are big enough for the max width you want to display.

You should now have a nice parallax scrolling effect for each node in the View list.

Parallax example

Dec 07 2019
Dec 07
 'custom_drush_create_node',
    'description' => dt('Triggers a node-save'),
    'aliases' => array('nc'),
    'arguments'   => array(
      'title'     => "Title of node",
    ),
    'options' => array(
      'repeat' => 'Number nodes to create.',
    ),
    'examples' => array(
      'drush nc error' => 'Prints error as node title is blank.',
      'drush nc Test --repeat=5' => 'Creates 5 nodes with title Test.',
    ),
  );
  return $items;
}

Running the Drush help command for our own command drush help nc will list some useful information about this command (arguments, options, description, aliases, examples etc)

Callback Function

As we have written callback function, Drush expects a function to be declared called drush_create_node(). This default naming structure starts with drush followed by the name of the command all connected with underscores.

function MYMODULE_create_node($title) {
  $repeat = drush_get_option('repeat', 1);
  for ($i=0; $i < $repeat; $i++) {
    $node = new stdClass();
    $node->type = "page";
    $node->title = $title;
    $node->language = LANGUAGE_NONE;
    $node->uid = 1;
    $node = node_submit($node);
    node_save($node);
  }
  drupal_set_message(t('Created ' . $repeat . ' node with title ' . $title));
}

Now clear the drush cache: drush cc drush

And run command: drush nc OR drush nodecreate

Arguments and options

-> Arguments are mandatory whereas options are not.

-> Arguments are passed as function parameters (in order) while options are retrieved in the callback using a special helper function (drush_get_option).

We declared 1 argument (called title) and one option called repeat.

-> The argument type will be the first string that gets written after the command name in the terminal (drush nodecreate or drush nc).

-> The option will be an integer value that gets assigned to the --repeat flag in the command.

Ex. drush nc Test --repeat=2

This will create 5 nodes, with title “Test”

User input

Let’s make it so that if a user doesn’t pass an argument, we ask them what argument they’d like to pass and use the value they provide interactively.

This goes to the top of the command callback function before checking whether the correct argument was passed.

// Check for existence of argument
if (!$title) {
  $options = array(
    'Test' => t('Test'),
    '0' => t('Error'),
  );
  $title = drush_choice($options, t('Please choose a option.'));
}
…
  1. Everything happens only if the user has not passed an argument.
  2. We create an array of key-value pairs that will represent the choices we give the user. The array keys represent the machine name of the choice while the values, the human readable name.
  3. We pass this array along side a question string to the drush_choice() function that will return the machine name of the choice the user makes. And that becomes our new $title variable (the argument).

If the title is not set or error is returned, we can add code to print error in terminal.

…
  if(!$title || $title='error') {
    drupal_set_message(t('Error! No title set.'));
  }
…

Full Code will look something like this:

 'custom_drush_create_node',
    'description' => dt('Triggers a node-save'),
    'aliases' => array('nc'),
    'arguments'   => array(
      'title'     => "Title of node",
    ),
    'options' => array(
      'repeat' => 'Number nodes to create.',
    ),
    'examples' => array(
      'drush nc error' => 'Prints error as node title is blank.',
      'drush nc Test --repeat=5' => 'Creates 5 nodes with title Test.',
    ),
  );
  return $items;
}
 
function MYMODULE_create_node($title) {
  if (!$title) {
    $options = array(
      'Test' => t('Test'),
      '0' => t('Error'),
    );
    $title = drush_choice($options, t('Please choose a option.'));
  }
  if(!$title || $title='error') {
    drupal_set_message(t('Error! No title set.'));
  }
  else {
    $repeat = drush_get_option('repeat', 1);
    for ($i=0; $i < $repeat; $i++) {
      $node = new stdClass();
      $node->type = "page";
      $node->title = $title;
      $node->language = LANGUAGE_NONE;
      $node->uid = 1;
      $node = node_submit($node);
      node_save($node);
    }
    drupal_set_message(t('Created ' . $repeat . ' node with title ' . $title));
  }
}

Feel free to drop your any queries/concern related to this blog. For Drupal Web Development we are always ready to help :) Stay tuned! 

Jun 11 2019
Jun 11

We have been an active Drupal community member since the past 6+ years, 7+ Drupal projects supported, 5000+ successfully delivered international projects and 500+ international Drupal projects - out of which 100+ projects are of Drupal Migration. And hence, we can help you in migrating your current Drupal 6/7 site to Drupal 8 and that too in a way that you will not have to spend a single penny for migrating to Drupal 9 in future. There’s a bunch of rational reasons to back this statement and offer of ours, which we’ll like to share with you:
 

  • Change in Drupal Philosophy
    Previously, every Drupal upgrade was considered to be tedious and more of a technical task as compared to its counterpart CMS platforms. This is because Drupal 8 was created with a philosophy of bridging the gap between the technical developer and a layman-like admin. And taking this philosophy of positive change, Drupal 9 is going to bridge the gap of upgrade issue by introducing compatibility between its older and newer version - making the entire process effortless and inexpensive.
     

  • Upgrade-based Modules
    The compatibility between the older and newer version of Drupal majorly depended upon the modules and themes used while building the older version. Until and unless these modules and themes aren’t upgraded, the migration was a time-taking task and tedious task that required technical assistance. This has been changed with the change in the upgrade path of the content, which makes the migration easier if prepared.
     

  • Drupal Core Deprecating Policy
    Drupal 8 capable of introducing new APIs and features against the old ones. And once these new ones are launched, the old ones automatically get deprecated. Though these old APIs cannot be removed in the minor release of  Drupal 8, it will be removed in the next major version of Drupal 9. Hence, if you migrate to Drupal 8 now, the migration to Drupal 9 can easily be done with just a handful of changes to make it compatible.
     

Looking at the above three major reasons, it must be clear to you that migrating to Drupal 9 from Drupal 8 is far easier as compared to the migration from Drupal 6/7 to Drupal 9. Dries Buytaert, the founder of Drupal, has also shared similar information about planning to be done for Drupal 9. According to him, Drupal 9 is basically built in Drupal 8 instead of a different codebase, altogether. This implies that the new features are added as backward-compatible code and experimental features, which means once the code is stable the old functionality will be deprecated.
 

Dries, in his blog on ‘Plan for Drupal 9’, has quoted contributed module authors as one of the core reasons behind the easy migration from Drupal 8 to Drupal 9. On this, he says that these are the module authors are already well-equipped with the upcoming technologies of Drupal 9 and hence they can priorly work in a manner that is Drupal 9 compatible. AddWeb, being one of these contributing members of the community, can assure you of the easy and inexpensive migration to Drupal 9 as and when it arrives.
 

Why Vouch for Drupal 9?
Now, after grasping all the above information regarding the upcoming major release of Drupal 9, you must be wondering what’s in Drupal 9 to vouch for. Let us throw some light on the same, to be able to bring some clarity for you. Drupal 9 is all about eliminating the use of deprecated modules and APIs. Drupal 8, which runs on the dependency of Symfony 3, will run out from the market by November 2021. And hence, it is highly advisable to upgrade and avail the benefits of all that’s latest!
 

Concluding Words:
As an expert #Drupal-er and active community member, AddWeb is all set to offer you with this amazing opportunity to migrate from your current Drupal 6/7 site to Drupal 8, in a way that the future migration to Drupal 9 will be super easy and inexpensive. Share your details with us in here and let our Drupal Migration Experts get back to you. In case, of any queries or suggestions feel free to get in touch with us!

Apr 29 2019
Apr 29

Advantages of govCMS:

The Australian Government created the govCMS distribution by combining Drupal Core and a specific set of Drupal modules. So that uniformity is maintained across all the Australian Government’s websites and it the creation of the same also becomes easy. Let us how else does this, govCMS distribution proves to be advantageous:

Cost-Effective

Individual web hosting and creation of the sites demand time and money. The higher the security and quality of these sites, the higher the costing. govCMS saves on both of these factors and simplifies the entire process by choosing a single provider and hosting platform on Acquia Cloud Site Factory PaaS Service. In fact, whenever there’s an increase in resource usage, one can always upgrade the platform, which is eventually beneficial to all the other govCMS sites also.

Government Standards Compliance

The entire govCMS is created in a way that it perfectly complies with the standards of the Federal Government. Hence, this makes the further process quite smooth and sorted. Security being one of the major concerns while creating a website for such Government organisations. And hence, govCMS has complied with their guideline by completing the program process of Information Security Registered Accessors. Plus, every issue that is found and rectified in govCMS will also automatically be implemented to other govCMS sites too.

Software Maintenance

Drupal is one of the largest open-source platform available today and hence it has a large team of 600 expert community members, who work on making govCMS a consistently growing and highly efficient product. This is taken care by Acquia, which also provides 24x7 assistance for govCMS at application and hardware level.   

Security Compliance

One constantly needs to confirm that there are no issues with the govCMS sites, for which a continuous process of testing, bug-fixing and other such process is required to be followed. This is very well taken care of, when it comes to govCMS and hence the security of this platform is kept intact. In fact, an automated testing process has also been set across the entire network by using Behat.

Responsive

In today’s day and age, a website that is not responsive is outdated. Fortunately, govCMS has been created with a base-theme that is responsive by default. This provides the developers in quick-creation of custom themes. This also helps in the creation of a standard look and feel of the Australian Government’s website, which converts into a user-friendly experience.

Accessibility Compliance

Every single Government website needs to be in compliance with the Web Content Accessibility Guideline (WCAG) AA 2.0. And hence, WCAG AA 2.0 has been at the base of creating the base-theme and hence it’s in complete compliance with the Government standards. This also helps in elevating the user-friendliness of the website. govCMS also provides a list of the accessible elements either via the content pages or the WYSIWYG editor.

Data Retention

Backups are a very critical and significant part of any website. So when it is a Government website, the stakes are even higher. The creation of govCMS is done in complete compliance with the National Archives of Australia Standards. This includes about 7 years of data retention on backups, which is a highly beneficial factor that works in the favour of these govCMS-based Australian Government’s websites.  

govCMS is a pool of perfection when it comes to a platform meant for Government - highly secure, affordable and effective! govCMS platform is a pool of perfection when it comes to a platform meant for creating any Government-based website. Because it is highly secure, affordable and effective! AddWeb is glad to have built a website created by using a govCMS platform, which is in complete compliance with WCAG 2.0 and government standards. And we’re all-equipped to work more on other such govCMS-based websites. If there’s anything specific in your mind that you wish to learn about govCMS then free to write to us in here and we’ll be happy to include the relevant topics in our future blogs.

Mar 27 2019
Mar 27

What is govCMS?

The govCMS distribution is supported in Drupal 7 and Drupal 8 version, which has installation profiles for Australian government websites and it is being actively managed on Github (https://github.com/govCMS/govCMS8) and features are maintained from https://www.govcms.gov.au/.
 

To work with govCMS, we have to take care of some factors in order to create a site with the govCMS platform.
 

They have limited number of the module they support and we have to stick to that only and need to find alternate options with the twig and preprocess functions only and they do not allow us to create custom modules as well.
 

Here is the list of modules that they support: https://www.govcms.gov.au/govCMS-d7-modules
 

Unfortunately supported modules for Drupal 8 are less compare to Drupal 7, but we can create support request of community and if it's valid then they can include a module on SaaS platform.
 

Our Experience about working with govCMS

We have worked with govCMS for one of our clients from Australia, who is working with another agency before we met, and already he had started site development with them, and fortunately, he gets to know about the quality of work done so far from the previous agency.

They have added lots of contrib modules and to achieve some functionality they have created custom modules as well, but as the govCMS platform doesn't support such modules we have to flush out all existing implementation and started from the beginning.

All features which are build using custom/contrib modules, we had to find alternatives and get things done only with supported modules and using preprocess functions and twig alters. and along with that, we have to make sure that site is WCAG compliance as it is a government website they must be. So all things we delivered to the client successfully as per the client's expectation with the boundary of govCMS restriction.


 

More details about what is govCMS

Drupal gets big in the Australian Government
 

With almost half of Australian Government departments now running Drupal, and hundreds of more sites now live within various agencies, Drupal has transformed the way government websites are built and managed.
 

Drupal 7: https://www.drupal.org/project/govcms

Drupal 8: https://www.drupal.org/project/govcms8
 

The aim is to provide a single solution for unclassified websites using a common codebase and a shared feature set on a scalable and secure list infrastructure.

govCMS distribution is supported as SaaS by amazeelabs in collaboration with govCMS community and it supports several contributed modules which are available, here is a list of modules which can be used with SaaS https://www.govcms.gov.au/govCMS-d7-modules.
 

Workflows and Ahoy

It is interesting to see that the .ahoy.yml is just a set of command shortcuts, which is similar to the scripts section of a composer.json. Every implementation can be smoothed over by a single Ahoy command, and the underlying implementation can evolve without the developer even noticing.

Speculating, I think the hardest part about adding Ahoy commands will be naming them. Even then, the govCMS team will have the luxury of focussing on the "SaaS govcms 8 on Lagoon" use case, rather than something like BLT which attempts to have commands for "any Drupal anywhere".

Jan 31 2019
Jan 31

Do you have a Drupal 8 website that you have migrated from Drupal 4 to 5 to 6 to 7 and then to 8 (or anywhere along this timeline)?

Do you have a Drupal 8 website that is not managed with Composer? (Maybe you installed the site manually?)

If your answer is Yes to any of the above, then this quick guide tutorial is for you. This tutorial will explain in 10 easy and proven steps how to take a Drupal 8 website and get it to be managed under Composer. 

Read how Drupal 8 uses Composer.

For this tutorial to be effective for you, you must take care of all the Assumptions I mentioned below BEFORE you start.

Assumptions

  • You have a Drupal 8 website and it is under GIT version control (using master branch).
  • You have not hacked core (but if you did note where you did it).
  • You have contrib modules and/or themes in your code base.
  • Any custom module or custom theme is in their usual Drupal folder (for e.g. drupal_root/modules/custom_module OR drupal_root/themes/custom_theme)
  • You have updated all Drupal core, contributed modules and themes to their latest stable version. (This is important for Step 6 to go smoothly)
  • For this tutorial code base means your Drupal root directory
my current codebaseMy current code base looks like this.

Step 1

Backup the following folders:

  • your public files folder

  • database

Do not worry about the rest of your code base because it is under version control.

 

Step 2

Git clone your code base locally and create a new branch off your master branch (or whatever branch your live repos sits on).

Commands

git clone

Now change directory into your newly cloned git repos.

git checkout -b composerize-drupal master

composerize-drupal is just the name of the branch we will be working in for this tutorial so we don't mess with our master branch. Once we are successful, we will merge this branch back into master.

 

Step 3

Note down the names of the contributed modules/themes that you currently use. It is ok to skip this step because your git version control (master branch) will have these folders still so you can refer to it from there through the git web interface.

But here are the Drush commands if you wish to do it this way:

To list all the contributed module: drush pm-list --type=Module --no-core --status=enabled

To list all the contributed themes: drush pm-list --type=Theme --no-core --status=enabled

If you hacked core or made custom patches, note down where these hacks/patches are in your codebase (again it should be viewable in your git interface in the master branch so you do not need to actually write this down)

Step 4

In your local branch , delete everything including all the files that begin with “.” (dot) from your Drupal root EXCEPT the .git folder. So now your code base should only have the .git folder.

Now you can stage and commit this change to the current branch composer-drupal:

git add -A

git commit -m "Remove all files and folders except .git"

 

Step 5

Install a new version of Drupal using Composer:

composer create-project drupal-composer/drupal-project:8.x-dev composerized-drupal --no-interaction

The name of the folder that composer will install Drupal too is composerized-drupal.

Now you need to move ALL of the files and folders from the folder composerized-drupal into the root of your original code base hence consequently leaving the composerized-drupal folder empty. Don't forget to move all the files that begin with a dot.

So from your code base root:

mv composerized-drupal/* ./

mv composerized-drupal/.* ./

rm -rf composerized-drupal

Now your code base should have the default Drupal composer files like Figure 2.

Figure 2Figure 2

Now it’s a good time to commit these changes.

git add -A

git commit -m "Added default Drupal composer files"

 

Step 6

For each contributed module, theme or profile from your old site you need to add it to the current code base by using composer such as:

composer require drupal/adsense drupal/backup_migrate drupal/codefilter drupal/ctools drupal/insert drupal/pathauto drupal/rules drupal/sharethis drupal/tagadelic drupal/token drupal/typed_data

Composer will then fetch the latest stable release and put it in the correct directory automatically.

Now it’s a good time to stage and commit your changes.

git add -A

git commit -m "Add contrib projects to the codebase."

Step 7

For any of your custom code:

  • Place modules in drupal_root/web/modules/custom/

  • Place themes in drupal_root/web/themes/custom/

  • Place profiles in drupal_root/web/profiles/custom/

Visit this link if you use 3rd party libraries.

If you made customizations to .htaccess or robots.txt, here is how to apply those changes in a composer managed Drupal site. (Don't forget to commit your changes to composer.json)

If you patched core, contributed modules or themes see this link to patch with composer.

NB - Do not just randomly add your customizations in without letting composer know about it. If you do this, your changes will be lost next time you run composer install or composer update.

 

Step 8

TEST, TEST, TEST!

Restore a copy of the LIVE database to your local machine and visit the URL of the local site in your browser.

Drupal will automatically go to the install step. Follow through with the process and fix any errors along the way.

Clear the cache: drush cr

You may have to find other ways to clear Drupal cache if Drush does not work at this point.

Check the status reports and click around the site. Any errors you find, fix it and commit it.

The status page may have Drupal updates to the database available. Update the Drupal database if you need too.

Usually I visit admin/config/media/file-system to double check the public and private folder paths are set correctly.

NB - your custom files folder will be missing from your code base at this point. You can copy the files folder locally to drupal_root/web/sites/default/files if you need it for testing purposes but this will be taken care of in Step 10 on the LIVE site.

At the end of this step, drush status and drush cr should return clean results with no errors.

 

Step 9

This is the big step where you push the changes up to the master branch.

So push your changes up: git push -u origin composerize-drupal

Now we want to merge our composer branch into master:

git checkout master

git merge --no-ff composerize-drupal

Delete the composer branch as we no longer need it:

git branch -d composerize-drupal

Push the changes up:

git push -u origin master

 

Step 10

Now we need to pull in the changes on your LIVE server. Your LIVE site will be down for a few minutes in this step so you should do this at an off-peak time. In the event that something drastically goes wrong, you would need to revert the commit with the merge and restore your database and files folder.

On LIVE:

Change your Webserver document root to point to code_base/web since composer would have placed all the Drupal files into a sub directory named “web.” This is a very important step.

Then

git pull

composer install --no-dev

After running the above command, if you had previously made customizations to core, contrib modules or contrib themes, and you didn't tell composer about it, they will be lost like I said in Step 7.

At this point you may notice your original sites folder is still at code_base/sites. You can delete the folder completely because the web/sites folder will be in use now.

Copy your custom files folder to code_base/web/sites/default/files

Now visit your site and repeat Step 8 (except restoring a copy of the LIVE database to your local as you would be on LIVE now).

I hope this tutorial is helpful to you. You can leave a comment if you had any edge cases and the solutions that you found.

Jan 16 2019
Jan 16

Happy 18th birthday to Drupal!

                      

We’re all engrossed in the mode of celebration and the festive fly game was on point. In fact, everyone else was too painted in that mood, cheering and celebrating the spirit of flying. But our zest for celebration was a notch hire, for our reason for celebration was doubled. 15th January is not merely a date when the kite-flying festival falls but that’s the very day when our dearest of all - Drupal came into existence!

Eighteen years before this very day, the very first version of Drupal - 1.0.0 was released by its founder - Dries Buytaert. And just as it happens with all other path-breaking changes world, this one too came with a lot of faith but a humble approach towards its future. And look, how proficiently has it grown in all these years. Today, it’s one of the largest and most-trusted open-source community and the future looks even brighter.  

In the age of data-threats, Drupal is trusted for its security, worldwide. Constantly moving towards strengthening the open-source community, Drupal has never compromised on the security, content, and scope. Drupal is also known for its power of personalisation and flexibility. Drupal Commerce is also the preferred one when it comes to building an easy-looking e-commerce platform with complex functionalities. And if that was not enough, the launch of Decoupled Drupal has blown the tech world like a boss!

We might sound a little biased here, but we’re speaking nothing but the truth. Everyone from ‘The Beatles’ to ‘Estee Lauder’, ‘Columbia University’, ‘NBC Universal’, ‘NBA’, ‘Paramount’ and many more have trusted and adapted Drupal for years now. Dries has rightly quoted about it in his birthday note for Drupal and let us also conclude, our birthday note for Drupal, on the very same note -

Dec 31 2018
Dec 31

Past is a place, thoroughly familiar and yet the experience of revisiting it varies drastically. Revisiting some leaves you with happy nostalgia, some with innocent laughter, some with a moment of pride, and some, a prick of sadness or regret. But yet we choose to visit this place called ‘past’ through our memory, time and again. In fact, we recently did so by revisiting the year 2018, like many others, that is about to end in just a handful of hours. And fortunately, it was filled with a host of happy moments to rejoice and relish, topped by several breakthrough changes and chances we’ve embraced with all love & warmth.


The year 2018 has been the most eventful year for the AddWeb-traveling, counting right from the moment of moving into altogether new office space to officially being a supporting partner of Drupal.org and everything in between. It’s a journey no less than a cinematic experience, with all the drama, emotions and heroic ending - full of catharsis. Let us take you through this marvelous journey, as experienced by AddWeb-ians.

Welcoming 2018 - The Journey Begins, Quite Literally!

Dec 21 2018
Dec 21

Continuous Delivery - A trending word in the world of technology. Continuous Delivery(CD), along with Continuous Integration(CI), is becoming a popular term even with the non-technical people. And hence, every IT company is seeing a flood of clients coming with the demand of both of them. Both of these techniques - CI/CD are closely associated with the quality-oriented work methodologies - Agile and DevOps. And so are we!

Team AddWeb has been for years been associated with and following Agile and DevOps. Just as we’re associated with Drupal. No wonder, we have been ardently following continuous delivery with Drupal for years now. So let us first throw some light on this popular concept of ‘Continuous Delivery with Drupal’.

What is Continuous Delivery?

Continuous Delivery is a process of automatically deploying all your changes made on development stage, directly to the production stage. This kind of delivery is done by accepting all the unit-cases followed by coding standards. Once the code is merged with the stage branch from the development branch, the same stage branch also gets an automatic update with the help of Jenkins and git-webhook, which is triggered by merging the branches. A similar process of automatic delivery is also followed on the production site; where the code is merged with the master branch from stage branch, which is later deployed to the production servers.

Team AddWeb, as we mentioned previously, has been persistent followers of CD with Drupal via Jenkins, Ansible, and RocketChat. We believe, in today’s day and age, CD, and CI hold so much of significance because one can define repetitive tasks for one time and then on every build the same mentioned steps will run in order to update the new content. And when we speak of so much so of its importance, let us also share the tools, block diagram and process that we, at AddWeb, choose to follow for Continuous Delivery.

Nov 03 2018
Nov 03

Team AddWeb has worked for a distinctive list of industries counting from hospitability to technology and retailers to an online lottery purchase system based website. Yes, we recently collaborated with a Japan-based company to build their website with lottery purchase system, using Drupal 8. We’ve been Drupal-ing even before our inception and have been an active member of the Drupal community, globally. Our association and experience of Drupal were the base of the client’s immense faith in us and we knew that we’re going to stand true to that.

About the Project
The project requirement of the client was to build a website for them in Drupal 8. The website is basically an online lottery purchase system. Due to confidential reasons, we can not share the name of the company/client but would like to share that the experience of working on this project was new and enriching.

 

Major Features/Functionalities
We personally love experimenting and implementing innovative features to enhance the client’s website. Plus, we get a little more excited when its a Drupal 8 website. We integrated a host of futuristic features to this very website too. But since, it’s an online lottery purchase system we knew that the integration of the Payment Gateway is going to be one of an integral part. Hence, we created three types of Payment Gateway, as follows:

  • GMO Payment

  • Coins Payment

  • WebMoney Payment

The user is an integral part of this entire online lottery system and hence several functionalities are crafted around them. Like, a user can purchase coins by WebMoney Payment method and can also buy lottery from choosing any product bundle. A user also has an option to select the quantity of the product or go for the complete set. The payment for either of it can be done by the coins, GMO credit card or points.

Draw system is used for the selection of the lottery winner. Other than the lottery prize, the user also stands a chance to win the Kiriban Product as a prize. The Kiriban Product is based on the product bundle configuration, which is an additional product that a user gets as defined by an admin user.

The Problem

Any e-commerce website will definitely have multiple users buying for the same product. In this situation, the backend technicalities should be as such that it updates the quantity left of the product after the last purchase is made. Issues occur when two or more users place the order at the same time. This is an issue that is involved in concurrent shopping. In this case, the lottery opened for some specific time. Hence, the issue occurred in showcasing the updated quantity. This problem came to our notice when the site went live and around 7-8 users made the transaction at one specific time. We immediately started working on the issue.

Challenges Faced:

We quickly picked up the problem and started searching for the resolution. We have had several times, prior to this, created an e-commerce website. Hence, we used multiple methods to resolve the issues, mentioned below, but none of them worked in this particular case.

  • Initially, we tried using a Drupal lock to resolve the issue, but in vain.

  • We, later on, used the MySQL lock but this too didn’t work, due to the involvement of multiple quantities inside for loop.

  • The usage of sleep time with random sleep time also did not work, because it created the nearby value and not the exact one.

Though the method of random sleep time did not work in this case, it gave birth to the final resolution that worked. And hence, we did a minor modification to the same and divided the sleep time in a range of 3. Also, to avoid the possibility of any further clash, we adopted a table of 100.

The Final Resolution:

After trying out a handful of methods, we finally came up with a method that did work out in our favor. Let us share what steps did finally help us in addressing the problem of concurrent shopping that we faced:

  • A table consisting of 1 to 100 numbers was taken, with the sleep time by a range of 3.

  • Later, a random number was picked and a flag value for the same was set.

  • Then, a greater number from those numbers with the range of 3 was picked.

Below is the table that was created to bring out the final solution:

Dec 30 2017
Dec 30

I presented at the first Drupal NYC Meetup of the year!

I've been hard at work building a new Provision: the command-line interface for Aegir. We are moving off Drush commands into our own CLI built in Symfony. The tool is finally a working MVP, so I figured it's time to spread the word! 

First I give a bit of background on the Aegir project and my goals for the project which can be summed up in one word: easy.

Then, I dive into the code that makes this system possible. If this project has any chance of surviving, I must win over developers to help grow and maintain it! Developer Experience is a high priority.

In the next few weeks, I'll be posting a series of blog posts about the new Provision 4.x, both for end users and developers.

Provision 4.x: Developer Sneak Peak

Aegir's back-end is getting an overhaul after 10 years of service. We're developing a brand new Symfony console based CLI for all of your website management needs: Provision 4.x.

With the power of Symfony console we've completely re-written Provision to be as easy and clear as possible, and flexible enough to work anywhere: cloud or workstation.

Can this new CLI become the defacto dev-test-production website management tool? Is it wrong to write DevOps tools in PHP? Can we keep Aegir going for another 10 years? 

Slides and Video are available.

*Photo credit: https://www.meetup.com/drupalnyc/photos/28451193/467353793/ 

Aug 08 2017
Aug 08

Paragraphs

Paragraphs are one of the modules that make site builder and end users more powerful. Paragraph module does this by replacing one big WYSIWYG with predefined paragraph types. Paragraph module utilizes entity reference field to reference paragraph types. Paragraphs are basically entities so users get control over fields and theming of the paragraph.

Bootstrap 

Bootstrap is sleek, intuitive, and powerful mobile first front-end framework for faster and easier web development. Bootstrap has become one of the most popular front-end frameworks and open source projects in the world.

A combination of these two is "Bootstrap Paragraph" module.

"The Bootstrap Paragraphs module provides a suite of content and layout Paragraph bundles made with the Bootstrap front-end framework."

Using bootstrap paragraph module, it is very easy to create features like an accordion, modals, tabs, multi column layouts, and many more things. 

The module has multiple dependencies including paragraphs, Entity reference revisions, contact formatter to name a few. The module also needs Bootstrap framework’s js and CSS added in site theme. Installing this module via composer could be beneficial.

Module installation follows a standard process. The module comes with predefined paragraph bundles which can be accessed from /admin/structure/paragraphs_type. These paragraph bundles are divided into 2 main categories: 

Content bundles

  • Simple HTML
  • Image
  • Blank
  • Contact Form
  • Drupal Block
  • View

Layout bundles

  • Accordion
  • Carousel
  • Columns (Even, up to 6)
  • Columns (3 Uneven)
  • Columns (2 Uneven)
  • Modal
  • Tabs

Each paragraph type comes with 2 options: 

Width and background color

Jul 12 2017
Jul 12
$nid = '29';
$node = node_load($nid);
$node->field_fname[LANGUAGE_NONE][0]['value'] = 'Johnny1';
$node->field_lname[LANGUAGE_NONE][0]['value'] = 'Harper1';
$node->field_address[LANGUAGE_NONE][0]['value'] = '405, Silicon Tower, Above Freezland Restaurant, Law Garden, Off C.G. road, Ahmedabad, Gujarat - 380009 India.';

field_attach_update('node', $node);
entity_get_controller('node')->resetCache(array($node->nid));
Jul 08 2017
Jul 08

Paragraphs is a contributed module which allows creation, administration, and display of customizable content components. In other words, Paragraphs gives you cleaner data structures so you can give more editing power to your end-users. 

This module replaces drupal’s standard body field with paragraph types. This allows any type of content to be added on the page including but not limited to HTML, images, videos etc. All these can be added by users. Users can add as many paragraphs as they like all the while keeping them all responsive. Developers can reuse paragraphs and layouts. 

Paragraphs are basic Drupal entities. This allows site builder control over fields used in paragraphs and their display. This also makes content saved in paragraphs compatible with Search API, views, and services. 

Below is the step by step instructions to work with Paragraphs module:

1 - Download and enable the module
Paragraphs module follows standard process to download and enable.  Module depends on entity reference revision. You can download and enable this module via drush as well.

2 - Add paragraph types
Paragraphs do not come with any predefined paragraph types. Developers can add as many paragraph types they want by going to admin > structure > paragraphs

Jun 21 2017
Jun 21
function ajax_multistep_form($form, &$form_state)
{
 
// If $form_state['step'] is not set then set default to 1
$form_state['step'] = isset($form_state['step']) ? $form_state['step'] : 1;
// Add a wrapper div to update the form using AJAX
$form['#prefix'] = '

'; $form['#suffix'] = '

';   switch($form_state['step']) { // Step 1 case 1: $fname_default_value = $lname_default_value = ''; if(isset($form_state['values']['step_1'])) { $fname_default_value = $form_state['values']['step_1']['fname']; $lname_default_value = $form_state['values']['step_1']['lname']; } elseif(isset($form_state['storage']['step_1'])) { $fname_default_value = $form_state['storage']['step_1']['fname']; $lname_default_value = $form_state['storage']['step_1']['lname']; }   $form['step_1'] = array( '#type' => 'fieldset', '#title' => t(''), '#collapsible' => false, '#collapsed' => false, ); $form['step_1']['fname'] = array( '#type'=>'textfield', '#required' => true, '#title'=>t('First Name'), '#default_value' => $fname_default_value, ); $form['step_1']['lname'] = array( '#type'=>'textfield', '#required' => true, '#title'=>t('Last name'), '#default_value' => $lname_default_value, ); break; // Step 2 case 2: $phone_default_value = ''; if(isset($form_state['values']['step_2'])) { $phone_default_value = $form_state['values']['step_2']['phone']; } elseif(isset($form_state['storage']['step_2'])) { $phone_default_value = $form_state['storage']['step_2']['phone']; }   $form['step_2'] = array( '#type' => 'fieldset', '#title' => t(''), '#collapsible' => false, '#collapsed' => false, ); $form['step_2']['phone'] = array( '#type'=>'textfield', '#required' => true, '#title'=>t('Phone Number'), '#default_value' => $phone_default_value, ); break; // Step 3 case 3: $city_default_value = $city_default_value = ''; if(isset($form_state['values']['step_3'])) { $street_default_value = $form_state['values']['step_3']['street']; $city_default_value = $form_state['values']['step_3']['city']; } elseif(isset($form_state['storage']['step_3'])) { $street_default_value = $form_state['storage']['step_3']['street']; $city_default_value = $form_state['storage']['step_3']['city']; }   $form['step_3'] = array( '#type' => 'fieldset', '#title' => t(''), '#collapsible' => false, '#collapsed' => false, ); $form['step_3']['street'] = array( '#type'=>'textfield', '#required' => true, '#title'=>t('Street Address'), '#default_value' => $street_default_value, );   $form['step_3']['city'] = array( '#type'=>'textfield', '#required' => true, '#title'=>t('City'), '#default_value' => $city_default_value, );   }     // Form Buttons $form['buttons'] = array ( '#type' => 'container', ); // If we are on step 1, we do not want a back button if($form_state['step'] !== 1) { $form['buttons']['back'] = array ( '#type' => 'submit', '#value' => t('Back'), '#limit_validation_errors' => array(), '#submit' => array('ajax_multistep_form_back_submit'), '#ajax' => array ( 'wrapper' => 'ajax_multistep_form', 'callback' => 'ajax_multistep_form_ajax_callback', ), ); }   if($form_state['step'] !== 3) { $form['buttons']['next'] = array ( '#type' => 'submit', '#value' => t('Next'), '#ajax' => array ( 'wrapper' => 'ajax_multistep_form', 'callback' => 'ajax_multistep_form_ajax_callback', ), ); } else { $form['buttons']['submit'] = array ( '#type' => 'submit', '#value' => t('Submit'), '#ajax' => array ( 'wrapper' => 'ajax_multistep_form', 'callback' => 'ajax_multistep_form_ajax_callback', ), ); } return $form; }
May 12 2017
May 12

Display modes are one of the core functionalities of Drupal 8. They are easy to create and provides great flexibility in terms of theming at entity viewing and editing level. Display modes are available for content, comment, contact messages, custom blocks, taxonomy terms, users. They are also available to views adding more power to views.

Display modes are located at Admin -> Structure -> Display modes -> View mode.

Two types of display modes are available: "view modes" and "form modes."  Both these are example of configuration entities.

View modes allows site builder to request a field to be rendered in a certain way. For example, we can have an article that has doctors field has entity reference. On article full mode display, we can request few details of doctor to be displayed. We can create a new display mode (“Doctor details”) to do so. On Doctor’s full view, we can include a brief summary of articles associated with them. 

To create View mode 

Navigate to Admin -> Structure -> Display modes -> View mode

1. Click on “Add view mode” to add new view mode

Apr 24 2017
Apr 24

This blog is all about Drupal Mail system. Email sending in Drupal is entirely straightforward. Essentially you just need to manage two stages to send an email to somebody:

In Drupal to sends an email we need to take care of two things:

  • Declare all the required properties (subject, body, headers, etc) under hook_mail().
  • Call drupal_mail() with the argument for actually sending the email.

However, in the situation like greater and complex site, the above strides won't be sufficient. In any case, Drupal gives us the Flexibility to redo email sending process, before that it's important to know how stuff functions in the background first, with the help of Drupal you can easily generate custom pdf using the print module. In this blog, I'll demonstrate to you how you can redo and extend the Drupal mail framework to satisfy your necessities.
                   
The Email Sending Process

While sending an email drupal_mail() function uses system class for sending an email. Each mail framework needs to actualize MailSystemInterface class to define its own mail sending conduct.

MailsystemInterface class utilizes two strategies:

  • format()  
  • mail()

The Mail System Module

Mail related settings can be set through Configuration > System > Mail System.

The mail system variable contains two things:

  • default-system => DefaultMailSystem
  • mailsystem_theme => current.

These key-value pairs are the settings you can adjust under the “Mail System Settings” fieldset.

Apr 06 2017
Apr 06
var styledMapType = new google.maps.StyledMapType([
  { elementType: 'geometry', stylers: [{color: '#EBE5E2'}]},
  { elementType: 'labels.text.fill', stylers: [{color: '#520000'}]},
  { elementType: 'labels.text.stroke', stylers: [{color: '#F5E8DA'}]},
  {
    featureType: 'administrative',
    elementType: 'geometry.stroke',
    stylers: [{color: '#C9A193'}]
  },
  {
    featureType: 'administrative.land_parcel',
    elementType: 'geometry.stroke',
    stylers: [{color: '#DCD6B2'}]
  },
  {
    featureType: 'administrative.land_parcel',
    elementType: 'labels.text.fill',
    stylers: [{color: '#AEA5A0'}]
  },
  {
    featureType: 'landscape.natural',
    elementType: 'geometry',
    stylers: [{color: '#DFDFBB'}]
  },
  {
    featureType: 'poi',
    elementType: 'geometry',
    stylers: [{color: '#DFC47F'}]
  },
  {
    featureType: 'poi',
    elementType: 'labels.text.fill',
    stylers: [{color: '#93746E'}]
  },
  {
    featureType: 'poi.park',
    elementType: 'geometry.fill',
    stylers: [{color: '#9DB04A'}]
  },
  {
    featureType: 'poi.park',
    elementType: 'labels.text.fill',
    stylers: [{color: '#197515'}]
  },
  {
    featureType: 'road',
    elementType: 'geometry',
    stylers: [{color: '#F5E4BF'}]
  },
  {
    featureType: 'road.arterial',
    elementType: 'geometry',
    stylers: [{color: '#FDFBF3'}]
  },
  {
    featureType: 'road.highway',
    elementType: 'geometry',
    stylers: [{color: '#F8C452'}]
  },
  {
    featureType: 'road.highway',
    elementType: 'geometry.stroke',
    stylers: [{color: '#E9BF79'}]
  },
  {
    featureType: 'road.highway.controlled_access',
    elementType: 'geometry',
    stylers: [{color: '#E97741'}]
  },
  {
    featureType: 'road.highway.controlled_access',
    elementType: 'geometry.stroke',
    stylers: [{color: '#DBA37F'}]
  },
  {
    featureType: 'road.local',
    elementType: 'labels.text.fill',
    stylers: [{color: '#80544F'}]
  },
  {
    featureType: 'transit.line',
    elementType: 'geometry',
    stylers: [{color: '#DFCD95'}]
  },
  {
    featureType: 'transit.line',
    elementType: 'labels.text.fill',
    stylers: [{color: '#8F726D'}]
  },
  {
    featureType: 'transit.line',
    elementType: 'labels.text.stroke',
    stylers: [{color: '#EBD9B0'}]
  },
  {
    featureType: 'transit.station',
    elementType: 'geometry',
    stylers: [{color: '#DFD2A9'}]
  },
  {
    featureType: 'water',
    elementType: 'geometry.fill',
    stylers: [{color: '#BAD3C2'}]
  },
  {
    featureType: 'water',
    elementType: 'labels.text.fill',
    stylers: [{color: '#8E9985'}]
  }
]);

Mar 14 2017
Mar 14

Facets allow users to search the site based on selected criteria. Using Facet API module we can add facets on site. For each field that is indexed, we can have facets. These facets can be configured and displayed on search pages. We have various configuration options available for this.

Many times we need to show these facets on pages that are not Search pages. Facet API module does provide this functionality. You need to create a view display of type "Facet blocks". Below are the steps to do so.

1 - Create a view of search index and a display of type "Facets Block". You can make this display in the same view as the search page.

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