- 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 is always free to join and post!
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 set title and body field values using Ajax.
Place this CodeLet to your custom module file(.module) or Create a Custom module for Drupal 8 as per documentation https://www.drupal.org/docs/8/creating-custom-modules.
First of all add a field(field_link) to your content type. after that add an ajax to that field as per CodeLet.
Ajax example to replace multiple fields on ajaxCallback.
You set multiple fields value on ajax trigger in Drupal 8.
This CodeLet integrates Aframe libray & displays images using Aframe. With a VR enabled device, you can then view it in VR. It first displays a wall of images. When user clicks on one of them, on a new page, it displays the image using aframe library.
Use this CodeLet to remove "N/A" option from radio button list options.
Place this CodeLet to your custom module file(.module) or Create a Custom module for Drupal 8 as per documentation https://www.drupal.org/docs/8/creating-custom-modules
This CodeLet will read data from an external API, parse the JSON response & build a node of specific type. It imports taxonomies & images as well.
The fascinating thing about this CodeLet is, it can import data to multi - value node fields, including multi widget fields & different field types.
This CodeLet demonstrates the use of hook_form_alter & hook_menu.
Using hook_form_alter, a text field is added to site information page. Once a API key is saved, the button has value 'Update configuration'
Using JSON menu, one can pull a node of type page, as JSON string.
This CodeLet let you programmatically create a form page and render same form on a block.
Create custom module and follow CodeLet instruction to create a form and block programmatically.
This CodeLet Sends an email after a node of specific content type is created. The CodeLet uses Drupal8 API which sends and email upon node creation. This CodeLet implement hook_entity_insert & hook_mail.
Place this CodeLet on your MYMODULE.module file.
This CodeLet will display a block content in a region programmatically.
You have to implement hook_preprocess_HOOK() in THEMENAME.theme file of your theme directory.
This CodeLet display related products of cart items on the Onepage Checkout at the bottom.
Follow steps to add related products on the Onepage checkout page.
1.) Edit the onepage.phtml file located at /app/design/frontend/default/your_template/template/checkout
2.) Add the following code end of the file:
This CodeLet will redirect the user to checkout page when user clicks on 'Buy now' button on the product
Use the code and create a custom module
Make sure you keep the weight of the module high in "system" table
This CodeLet add already implemented "Pass ids as arguments to page" on VBO.
Place this CodeLet to your custom module, you can see the customization on Bulk Operations field on the image.
This CodeLet will ajaxify the respective element and will trigger an event. Respective action will be taken by the code and displayed on the form within the specified wrapper
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