You are here

Drupal is a free and open source Content Management System (CMS) and Content Management Framework (CMF) written in PHP. It's use as a back-end system varies from personal blogs to corporate, political, and government sites.
snippet - Load a file by uri in Drupal 7
16 May, 2018
This snippet shows you how to load a file by uri. Basically this option is available with file_load_mulitple only.
snippet - Field group alter to add html in Drupal 7
4 May, 2018
Field group lets you do some amazing forms. Still when you have empty element or the form just is too long and needs some custom modifications, you can then use prefix and suffix from form api to...
snippet - Delete all terms from all vocabularies in Drupal 7
26 Mar, 2018
Delete all terms from all vocabularies in Drupal 7. This is ran by Drush, but you can run it from wherever Drupal is initialised.
snippet - Drupal 7 commerce add product variation types programmatically
12 Mar, 2018
Example for how to create product variation types programmatically.
snippet - Drupal 7: Wrapping group by content in Views
24 Feb, 2016
You can use "group by" in views to group data by a field. When you start writing css for it, or even use accordion. You need to wrap the rows into a container. This can be achieved by creating a...
snippet - Change line item price programmatically in Drupal 7
29 Nov, 2015
Changing line item price is not as easy as you could think. It can seem that the price has changed, but there are multiple places where you have to actually change it. Especially when you compute the...
snippet - Check if current user has node edit permission in Drupal 7
19 Nov, 2015
Just a snippet that shows how to check if current user has edit permissions for some node in Drupal 7. Using node_access function like in the example you are also able to check permissions for...
snippet - Add template files to your module
9 Nov, 2015
This nifty little snippet will scan your module for tpl.php files.
snippet - Uninstall modules programmatically in Drupal 7
13 Jul, 2015
Snippet shows how to uninstall modules programmatically. This is not deleting the files, but doing a full uninstall.
snippet - Get GET parameters in Drupal 7
23 Mar, 2015
Getting URL query parameters array where unwanted elements are removed. For that you can use drupal_get_query_parameters function. In default q parameter will be removed. That parameter includes...