If you run into a Drupal 7 site with file system access and you would want to change the password of a user in the system programmatically, here is an easy way to do this.
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.
The World Wide Web is getting cluttered with numerous brands and products. In this scenario, how will you get search engines to favour your Drupal website? Search engines are obsessed with quality content and so your “content” is ultimately going to decide how well your website gets ranked in search engine results. Drupal is the best and most efficient platform for you to easily create and manage your content.
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,
This article covers how to the Install and configure Readmore Js via the theme. Readmore is a lightweight and Responsive jQuery plugin that automatically generates a Read More link for users to click and read the rest of the content.
In this article lets checkout how to fetch tweet count for a Drupal website. For this purpose we are using the Count API of twitter. Compared to Facebook on fetching likes and share counts we will notice a little difference. Simplest way to acquire the tweet count is to send request to the below url:
We can display user's identity based on their properties other than username, including actual name, email address, or user ID using the module RealName .
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.
Technology has completely changed the way businesses were operated in the past. Now, marketers can make their products available to the customers at their finger tips at any place and time. About two decades ago, nobody could ever imagine that buying and selling would be carried out in such a seamless manner sans the brick and mortar retail outlets. All this has been possible only because of technological advancements. Technology is progressing in leaps and bounds, opening newer avenues for success.
Form API validation is a contributed module which allows us to write the validation rules in custom forms, without the use of hook_validate/form_validate function
To submit a Drupal form, suppose a registration form to Hubspot we need the following.
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.
Simple news module is used to integrate newsletter subscriptions to a drupal website. Simplenews publishes and sends newsletters to lists of subscribers
The Commerce Card on File module provides an API with a user interface for storing and reusing credit card data on subsequent orders. This module didn't hold full card numbers locally. Instead of this it stores the remote ID of the full card data from the payment gateway that is used to validate and process your credit card transactions.
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.
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.