Drupal

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.

Drupal 8 : Introduction to Big Pipe

The Big Pipe is the new methodology for loading web pages. While using Big Pipe concept it will split request into multiple requests this request is sent parallel for the server. The server completes its first request from multiple, then sent the response to the browser. The Browser will not wait for all responses. Whenever it will receive a response it will render output.

Drupal 7: CTools adding JS to Modal window with example[ctools_add_js()]

In Drupal core the function drupal_add_js() help us to achieve adding JS for a specific pages. The CTools modal popup will not support core drupal_add_js() functions. We have to use CTools functions for adding JS files to modal window. The function ctools_add_js() will help to adding JS files into modal popup windows. The function accepts filename, Module name and path for adding the JS file.

Drupal 7: CTools Image button with Example [ctools_modal_image_button()]

The CTools not supporting normal l() function of Drupal, we need to use its own function for creating links and buttons. The below example will demonstrate about creating Image link button with an example. The function ctools_modal_image_button() used for creating image button by CTools.

Drupal 7: Programatically Creating CTools Buttons [ctools_ajax_text_button()]

The CTools plugin will not open with normal buttons and links. To open a page or form via CTools we need to use ctools buttons(ctools_ajax_text_button()). This ctools_ajax_text_button will create a link that contains the base class that help to pop up the pages.

Drupal 7: Adding Drupal set messages using PHP(drupal_set_message()) and Javascript:

In Drupal messages are printed using the PHP function drupal_set_messages(). This article will discuss the adding message to page through the PHP as well as Javascript. The normally the set message will create a div HTML wrapper for display the messages. Using the classes of the set message we can display the Error/Status/Warning message to the end users.

JQuery: Get/Load Element by ID (or) Clases with spaces - Sample code

In Jquery we allowed accessing the element by its class or ID. If we use the help of class means the '.'(dot) followed by class name will help us to access the information. If we use ID means, the '#'(hash) followed by ID name help us to load the element object. The below is the accessing element property.

Drupal 7: Commerce POS Accessing Order object

The Drupal Commerce Commerce POS module help us to achieve Point of Sale concept. The Drupal Commerce POS differs from normal commerce order. On Commerce POS they have implemented their own Order management rather than using Commerce Order. This has been achieved by its own interface and classes. On Completing each order, the order is again mapped to normal commerce order.

Drupal 7: Render Drupal system forms in custom module[drupal_get_form()]

The function drupal_get_form() is used to get the form details. Normally in Drupa,l the form field are constructed as an associative array. This associative array is defined inside a form function. The function name is the form ID, using this form ID we can able to render the form.

Drupal 7: CURL HTTP request with example(drupal_http_request())

The CURL is the PHP functionality for access external website contents. Using CURL request we can get content data, content or files from any other service providing websites. In Drupal 7 the function drupal_http_request(), will help to achieve CURL request for us.

Drupal 8: Programatically create Add another field - Example

In Drupal for form fields we able to capture multiple values by specifying unlimited values in manage fields. A similar manner for custom fields added in form alters also able to capture multiple values. The below is the example of creating multiple value capture field with add another button.