- Drupal Developer helps you to learn Drupal by Live code examples!
- Learn to develop custom Drupal modules and themes for Drupal 5, Drupal 6, Drupal 7 and Drupal 8
- Post your Drupal questions and get solutions.
- It's free to join and post!
This CodLet will dispay a userpoint form on node pages which allow the current user to donate some userpoints to the author of the node. This CodeLet will award the points to admin user by default.
This CodeLet will generate the number of Drupal sub sites you specify. It requires path to mysql executable on your server. The sub sites will be pre-populated with an SQL file.
This CodeLet allows to set the user password during Rule execution, the following process can be used.
a) create user entity ($newuser)
b) set a rules variable $password (use PHP code to generate a random string)
c) execute custom PHP which looks like
This way, you can also use the variable $password in say, an email to the user letting them know what their automatically generated password is.
This CodeLet alter the 'uc_paypal_wps_email' variable when PayPal payment is enabled with Ubercart & sets to node author's PayPal account email address.
This requires creating a field on user's account with name 'PayPal Email' (field_paypal_email).
This CodeLet recycles coupons created using Ubercart coupon module. The CodeLet chooses a coupon randomly from the available active coupons and send an email with coupon details to respective users. The coupon is remain active uintil defined period and then expires. This CodeLet, when cron runs, activates those coupons and those can be used again.
This CodeLet enables a Drupal site to moderate the comments automatically. Once a user's comment has been white lited, all his/her furture comments will be automatically moderated without admin to review them.
This CodeLet will Dispaly poll choice radio as a Button and view result on click of button.
This CodeLet creates a tiled dispay of taxonomy block with child terms. If you use taxonomy image module, you can select the preset and taxonomy on block configuration page. The CodeLet then fetches all the tree along with their images and display in tile in the block.
This CodeLet adds a field on Drupal registration form and allows the user to upload an avatar. This will be saved to user's picuture field on his/her profile. This will work only if 'Picutre' is enabled by the admin.
This is just a two lines of CodeLet which allows you to redirect your users after they log in to your site. This not complex and super quick
This CodeLet create Transparent png image from 'string', with responsive width.
This CodeLet allows you to set any image associated with certain contant type to be used as user profile image. This CodeLet particularly uses 'galleryimage' content type.
This CodeLet allows to add products to cart from code. The current product uses an extra text field. The cart view has been modified to accomodate extra fields from the product
This CodeLet will create hash for your admin password. You can provide the string for password and the CodeLet will generate the hash. You can then copy this hash and add in password field in the users table. The code has to be put in index.php of your Drupal installation and the order of the code is important.
This CodeLet demonstration how to create a custom node in code and use different Drupal hooks to build different features.
The CodeLet implements following Drupal hooks:
This CodeLet also creates an xml document which will then be used by the gallery to display images as slideshow.