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 - Delete all terms 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...
snippet - Post data to external url in Drupal 7
4 Mar, 2015
Sending data using POST to external url should be done by using drupal_http_request.
snippet - Edit field output before it is rendered in Drupal 7 using hook
18 Feb, 2015
Edit field output after the field module has performed the operation. This gives you possibility to alter the field output before rendered in your module. This works with display suite and other...