Moving to Drupal 8 deserves careful consideration in the technical front,especially when it comes to migrating from an almost stable platform like Drupal 7. Having said that, considering the advantages of Drupal 8, it will likely be the best solution for your business.
The term ‘Migrate’ in the context of Drupal means re-creating the content and configuration of a source site (usually Drupal 6 or Drupal 7) in a new Drupal 8 installation. In earlier versions of Drupal, the common practice was to provide an upgrade path. i.e., update the code to the latest version and then upgrade the database structure according to the code. Once it is done, the content is updated separately.
In one of my recent project I had a task to create a content type with a select list field of all image styles. But how can we get all image styles in Drupal? In Drupal there is an option to create different image styles using a module 'image'. Image module allows users to upload images into Drupal with proper permissions along with this its thumbnails and additional sizes are created automatically. Image module also gives an image_styles() function that can be used to get all image styles and their settings.
This article explains how to replace tokens to webform, views, blocks and Drupal forms from the node body. The preg_replace function for replacing the tokens. The preg_replace function works in the same way as preg_match. preg_replace is used to search a regular expression and replace it.
This article covers to the How to integrate Single Page Site module in a Drupal website. Single page site is of one of the newest trends in web designing. It allows you to automatically create a single page from a menu. The single page module will render all contents from the configured menus and links.It will then override the menu links so that they refer to an anchor instead of a new page.
Before we discuss on how to to join multiple database tables using db_select in Drupal 7, let me tell you that we can add as many joins as we want and most methods such as, 'fields', 'conditions', joins etc. can be called multiple times. However, one thing may be worth mentioning is that the call to join() needs to be separate. It should not be "chained", meaning that one should use this,
In order to add a new theme template file (.tpl.php file), we need to implement hook_theme() in our Drupal 7 module. A theme template need to be specified in the hook_theme() function. They produce HTML and renders Drupal render array elements to the screen.
While using the D3 implementation in one of my project for collapsible tree, I used the following piece of codes to add dragging and zooming feature in the tree. At first I have downloaded the D3 JS and loaded to the page callback as specified in the D3 implementation notes.
We can create custom rules programmatically using the function hook_rules_action_info(). hook_rules_action_info() is a useful hook provided by rules API to create custom rules programmatically. We can use our custom functions to perform the actions that we require.
Following is a sample of the hook_rules_action_info implementation:
The Paragraphs module is a new way of content creation. Instead of putting all contents through WYSIWYG body field, including videos and images, end-users can now choose on-the-fly between pre-defined Paragraph Types independent from one another.
In Drupal 7, when we do customizations we would want the custom module to create content in the form of a render array. We know that a page callback should return a render array which allows the custom module to handle the content as long as possible in the page generation process. Sometimes, wrapping two render array elements together could be an easy way out while dealing with render array manipulations. Here is how we can achieve that.