Drupal

How to get current content moderation state in drupal 8.

Currently upon editing a node has workflow current state displayed on the node edit page. This information will not be available on node_load or entity load. Since the current workflow or content moderation state information will be on latest revision of that content. All just you need to do is to load the latest revision of the content.

Enable gzip compression for your website using htaccess file

Gzip compression is a method of compressing files to make them them smaller so that it will be faster for network transfers. It is a standard practice that we must enable compression for production websites. We can enable gzip compression by adding following set of code in your .htaccess file.

Drupal Commerce: Get order quantity from order_id with sample code

In Drupal, commerce order contains multiple products. These products are attached to the line item to the orders. The line item table holds the information about the quantities and other information. The below is the simplest code to get the quantity of the order with different products.

Drupal 7 Commerce: Programatically adding the Billing and Shipping informations to Order

In Drupal, commerce order contains both Billing and shipping information on normal checkout process. If we are creating the commerce order programmatically then we have to add this information in manually. The below is the example of code for adding the Billing and shipping address to the order.

Drupal 6: Database Select, Insert, Update and Delete Query with example

In Drupal system have its own query builder it will create a query on Drupal way and sent to the Database server. To run a Database query we have built our condition on a specific format. The function db_query() function helps us to achieve run database queries in Drupal 6. The below is the syntax and example using a different type of Database queries.

Drupal 8 Composer Workflow

The Composer is a tool for dependency management in PHP. It manages to Install and update libraries that project managers. This session elaborate about how composer is used in Drupal 8. In Drupal Composer is inspired from node's NPM and ruby's bundler. Composer manages packages/libraries per project on the particular directory (by Default directory Vendor), so it has more features then Package managers.

Drupal and security - Advice for Site Builders and Coders

The primary goal of this session is to give people a solid basis in the most common security issues so they can quickly identify those security issues. From there, we'll move into some other common pain-points of site builders like frequently made mistakes, modules to enhance security, and evaluating contributed module quality.

Drupal Coding Standards - do and don't

In each and every language there is a need of following coding standards. The Coding standard will differ based on each language. This article will demonstrate the coding standard we should following for Drupal Content Management System(CMS). This article compares coding standards for both Drupal 7 and Drupal 8 with some demos. Also, it will support the best approach to hack the Drupal Core and Contrib modules.