In this article will be explaining how to store user IP address to a custom table during registration and display the result using views.
Custom Module
In Drupal 7, a theme function is a PHP function that is used to wrap the output variables with HTML. For adding a theme function in our custom Drupal 7 module, we need to implement hook_theme(). A theme function is prefixed with 'theme_'. However, they can't override existing theme functions. Such functions are invoked using theme() rather than being directly called. Also, they are faster compared to the template (.tpl) file implementations.
As the name suggests, a preprocess function is a precursor to a theme function. It runs first, irrespective of the fact that the theme function can also be implemented as a template (.tpl file) rather than a function. Preprocess functions can be implemented in both modules and themes. However, the preprocess implementations from modules run first, and those by themes run only last.
We were working on creating a custom Drupal 7 module for making the comment management better. At some point, we started getting an error. Since the error came during the development, we were almost sure that it was from the custom module only.
I had a requirement in one of my Drupal project to generate PDF from HTML. I had implemented the PDF file from HTML using the module MPDF. Let me explain you the following configurations for its working :
I faced a problem to create a taxonomy vocabulary term when my custom module was enabled. To save a vocabulary we just need a Taxonomy vocabulary save. But here I had to enable it whenever my module is enabled. So I checked out and found this method to add a new taxanomy vocabulary.
Drupal 8 is the latest version of Drupal. There are significant differences between Drupal 8 and Drupal 7. Firstly, Drupal 8 requires the latest version of php5 to run. Drupal 8 uses a PHP framework called Symphony, which relies heavily on OOP. Another major change in Drupal 8 is the folder structure. In Drupal 8, all core modules are placed within core/ and all other modules are placed in root modules folder. Moreover, there are changes in the way modules are created. Read on to know how to create a custom module in Drupal 8.
You may be familiar with the theme information link in views. The theme information link in view tells us which files are to be modified, to theme the view. You could get more information regarding the view from, http://viewshelp.doc.logrus.com/help/views/analyze-theme. This is the case where we have a theme with us. But what if you don't have a theme and you still want to theme the view's result? Well, read on if you want to find out how to theme a view by adding a template file inside your custom module.
Drupal modules can be defined as a collective set of functions that can be used to create certain features. There are two sets of Drupal modules - 'Contributed modules' and 'custom modules'. Contributed modules are modules that are contributed by Drupal users for general use whereas modules which we create to achieve certain functions are called 'custom' modules. If you want to know how to create a module on your own in Drupal 7, you may read on.
Many Drupal users wanted to know how to make Boost cache the HTML output of their custom modules. If you are a Drupal user facing the same issue in your Drupal site and would like to know how to make Boost cache the HTML of some of your custom modules then read on to find out the solution.
Suppose you have a checkbox in a Drupal webform that needs to be validated before submitting the form. You may be familiar with Drupal form validation but you can add validation using Javascript too. If you have a Drupal form in your Drupal website and want to know how to add Javascript validation to a checkbox to a Drupal form then read on