In one of my work, there was a requirement to uncheck the option for 'Generate automatic url alias' checkbox for all nodes. I used the Pathauto module with version 7.x-1.2 for handling standard urls in the site. When changing a node title, its URL automatically changes.
For a recent project, I had a requirement to implement menu tabs in Drupal 7. Let see what are the necessary code for the same. First I created menu tabs in .module file using hook_menu() with the following codes.
A patch is a small file which shows what was changed in a repository. It shows the new changes in an existing file, details of the new files in the current directory, file deletion details etc. A patch file can be pushed to the git repository so that it is useful in the future for updating the changes in the corresponding file.
To render a Drupal form to a node, drupal_build_form function is used. This function allows us to render all forms except the admin forms. Note that, admin forms didn't find success while rendering the same. In-order to render a form the following syntax is used,
For a recent Drupal project there was a requirement to find the pages that a user visits on the site and send that to Google Analytics. Here, first we should save the page links that the user visits. But for this we need,
I came across a situation in my recent project, where user roles other than admin have to access the admin pages. The default admin theme was not provided for the admin pages in which the user role is not admin.
Drupal has a module which allows us to add the admin theme to specific pages irrespective of the user role. Below are the steps which I followed to achieve this.
Administration Menu Source module is used to display different menus based on the roles existing in the system. This module is only available in Drupal 7. We can install the module using the following steps :
Deleting a content type in Drupal 7 is very simple. We just go to admin/structure/types and click delete button of the content type which we need to delete. But in the case of Ubercart, there is no delete link in product content type (admin/structure/types). So how we can delete this?
Many Drupal users wanted to know if there was a functionality similar to UberCart test_gateway for Drupal Commerce for emulating the collection of credit cards. If you are faced with the same question while running Drupal Commerce on your Drupal site then read on to know the possible solutions.
By using Views Slideshow module we could simplify the procedure of developing a slideshow in Drupal. As per the requirement I have found one feature lacking, i.e, a full screen option. I like to introduce a script that would turn slideshow images to the size of browser window.
In one of my work, I want to programmatically uncheck the checkbox option of 'Generate automatic url alias' for a specific node editing form. For this, I have created the following form alter for the content type. I have added a custom after build function for the necessary content type in the form alter.
When I planned to use media upload in CKeditor for uploading files to the site, I faced one problem, i.e. I could use only predefined image style as preset to style my image. I wanted to use a custom preset to media upload. To achieve that we have to do some customization.
Slick is a powerful solution for slideshow/carousel. It supports nested sliders and can be implemented in your custom block of Drupal 7 site. Slick has jQuery dependency. Download the latest jQuery and use in your page or use jQuery update module for Drupal 7.