Git is a free software and distributed version control system. We can maintain and track our project files in a git repository. It is a modern version control system that replaces the legacy centralized systems like CVS, Subversion etc.
We can call Git a 'social network' for programmers or developers, which gives speed and efficiency in development. Different commands are used to handle the operations in git.
Technical Solution
| 2
min read
As part of Drupal development project, we always use drush commands. Drush or Drupal shell refers to a command-line shell and scripting interface for Drupal. Drush enables developers to effectively manage and maintain their Drupal websites from the server command line. A few frequently used commands are listed below.
Drupal Technical
| 3
min read
Do you want to add a user to an organic group programmatically in Drupal, then here is a solution. In one of my Drupal module I had a requirement to add users programmatically to an organic group. So I have created a custom function in my module for this purpose. This uses the function og_group to add a user entity to a group. Refer the following code. Remember that, you can add only an existing user to a group. It will not create a new user.
Drupal Technical
| 2
min read
If you want to display some custom text related to an entity (which are not part of the entities fields. Eg. Calculated sum based on some values of the fields) in your apache solr search result, you can do it in two simple steps.
Technical Solution
| 2
min read
In one of my Drupal projects, I was using metatag module to specify metatags in my entity. When I enabled the module in Drupal modules configurations and set metatgs in my contents, it was working perfectly. After some days I want to customize my content page, so I created a custom page template file for the content. Then onwards, in the Drupal site the metatgs I set is not showing in the content page.
Drupal Technical
| 3
min read
In Drupal 6, the configuration of vocabulary itself has an option to specify the content types that requires this vocabulary. There is only global settings for the vocabulary. If we set the vocabulary as multiple select, it will apply to all of the content types to which it belongs. We can not set this field as multiple select in one content type and single select in others.
Drupal Technical
| 3
min read
I have a vocabulary in my drupal project and I want to make the vocabulary as a single select in one of my content types. I can do it in the form_alter. But to select the vocabulary item in the form_alter, I need its vocabulary-id. I dont want to hard code vocabulary-id in my code, so I searched for a drupal core function to get the vocabulary id from its name. In drupal 7 there is a function to get the entire vocabulary object from its machine name. But in drupal 6 there is no core function to get vocabulary id from its name. So I created a custom function to get the vocabulary id from its name. See the following function I programmed, to get the vocabulary id from its name.
Drupal Technical
| 2
min read
Drupal 6 will not allow you to create multiple access callbacks for a menu. In hook menu, the access callback will accept only string value, not an array. But I had a requirement in my project to add a custom access callback without removing the existing access callback. My custom access callback should be executed first. After that if some condition satisfies in my custom function the original access callback should get executed.
Drupal Technical
| 3
min read
In one of my drupal projects, I had a requirement to open some search result page in a new tab. I had given '#' as a place holder for the href attribute of the search link that needs to execute a javascript function on click to open the search result page on new tabs. I have added necessary code on the click event of this link to open the search results in new tabs and it was working properly. But when I click on this search link the current tab will go to the top of the page, since the '#' attribute will redirect to the top of the page.
Drupal Technical
| 3
min read
There are situations where we need organic groups membership entity ID. Some of situations are : we use the function og_membership_delete() when we want to remove programmatically a user or node or any group content from our group, which will require parameter that is organic groups membership entity ID. Also when come across og_membership_load() function to get the entire organic groups membership object, which will also require OG membership entity ID as parameter. So in these situations how can we get organic groups membership object membership entity ID. See the following function I have written to retrieve the organic groups membership object membership entity Id.