Skip to main content
Home
Toggle menu

Main navigation

  • Home
  • Blogs

Blog

How to add Welcome message on site

To show welcome message in Drupal we can identify whether user is logged in or not using simple code snippet below.
  • Read more about How to add Welcome message on site

jQuery - Find element by Text

The above code will find the HTML element i.e. div in our case, containing text as "John", and add underline to it.
  • Read more about jQuery - Find element by Text

Get number of hours between 2 timezones

Here is how you can find the difference between two different timezones
<?php
  // Set time to UTC
  date_default_timezone_set("UTC");
  $utc = date("Y-m-d h:i:s A"); // Get current time as per UTC.
  • Read more about Get number of hours between 2 timezones

How to use drupal_http_request()

Recently I was working on a project where I was wanted to make a request to another website to submit data from Drupal site. PHP provides very useful method for it i.e. cURL.
  • Read more about How to use drupal_http_request()

Drupal Commerce - How to change currency format

I've worked with Drupal commerce with almost 3 major project till now, and I'm seriously loving it the way it is flexible and configurable using Website UI and even with code. In current project which I'm working on was having some p
  • Read more about Drupal Commerce - How to change currency format

Configure Sendmail with Wamp

Now a days there are always tasks which require email notification, such examples are notify user on account creation, periodic notification for activities done by user, notify user on submission of form, etc. There are lots of other cases where you need to test the email and its content.
  • Read more about Configure Sendmail with Wamp

How to alter views exposed filter allowed value list

Just came across a situation, where wanted to alter the allowed values in views exposed filter depending on users who are viewing them. View allows site admin to expose its filter value to user, so they can apply different filters while viewing views output.
  • Read more about How to alter views exposed filter allowed value list

Programmatically output webform block

Webform module provides a way to create forms, which can be used as contests, personalized contact forms, or petitions, etc.
  • Read more about Programmatically output webform block

Get allowed values of select list field

Ever wanted to retrieve a list of allowed values of select list, here's a sample code:
  <?php
    $field = field_info_field('FIELD_NAME');
    $allowed_values = list_allowed_values($field);
  • Read more about Get allowed values of select list field

Programmatically render a block

Blocks are the boxes of content (such as "User Login" or "Who's online") that can be displayed in regions (such as footer or sidebar) on your page. Blocks are made available to your site most commonly by enabling modules.
  • Read more about Programmatically render a block

Pagination

  • First page First
  • Previous page Previous
  • Page 1
  • Page 2
  • Page 3
  • Page 4
  • Current page 5
  • Page 6
  • Next page Next
  • Last page Last
Subscribe to Blog

Monthly archive

  • June 2014 1
  • March 2014 3
  • February 2014 2
  • January 2014 2
  • December 2013 3

Pagination

  • Previous page ‹‹
  • Next page ››
sfy39587stp18