Tag Archives: Drupal Development

Drupal – Get Path Alias from Node ID/nid

With Pathauto, we could configure the node path alias in a much convenient way. Sometimes, we may want to get those alias in code during Drupal development. The following function will return the path alias from a nid. Continue reading Drupal – Get Path Alias from Node ID/nid

Drupal – Force Path Prefix for Default Language

Update: 2012-04-18: This solution is for Drupal 6 and it hacked the Drupal core. So please apply it with extreme caution. For Drupal 7, please try the approach suggested by outsourcer.

When you have more than one language on Drupal site, you have to define the default language among one of them. For example, if i set English as the default language, it will be shown in both http://<domain_name>/ and http://<domain_name>/en. but all the links in the default language will not have the en path prefix. Continue reading Drupal – Force Path Prefix for Default Language

Drupal – Enable Quantity Field for Ubercart Add to cart form

Update @ 2015-04-27: There is a simpler way to achieve this without coding. Please refer to this comment.

In the Ubercart product page, the product quantity option in the add to cart form is hidden by default. If you want to allow user modifying the product quantity in the order, create a custom module and implement the following hook. Continue reading Drupal – Enable Quantity Field for Ubercart Add to cart form