Some time ago, we talked about translating some Drupal site variables such as site name through defining them in the sites/default/settings.php.
Drupal – Site Name Translation Continue reading Drupal – Translate User Registration Email
Tag Archives: Drupal
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 – Render Node Comment Form
Node Comment allows you to create the content type as comment. Instead of having only comment title and body, Node Comment lets you add CCK fields to comment content type.
Normally, if we want to render the default node comment form, you can use the drupal_get_form() function. Continue reading Drupal – Render Node Comment Form
Mac – Generate SSH Keypair
Prior to the topic about the SSH keypair, i would like to let u know that the BeansTag module is already submitted to drupal.org and now undergoing the approval process. BeansTag is a light-weight and user friendly SEO tool which help you setting the meta attributes as well as page title. It is also multilingual supported. Visit the BeansTag project page to get more ideas or even try it with your Drupal 7.
Before i could start working with the Git repository hosted in drupal.org, i have to create a SSH keypair and add it in my Drupal account profile. Actually i have done the similar task before but that is for Windows. For your reference, you can refer to the following post.
Mac – Git installation on OSX
I am working on a new Drupal 7 module which is called BeansTag and hopefully it could be submitted to drupal.org soon. But before i could submit it, i have to make the Git work in my Mac OSX.
Here are the steps for Git installation in Mac OSX Continue reading Mac – Git installation on OSX
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 – Get Image/File path by File ID(fid)
You can get the image/file path by fid using the field_flie_load() function. Continue reading Drupal – Get Image/File path by File ID(fid)
Drupal – Cron Failure
You may meet the following error when trying to run a cron in Drupal
- Attempting to re-run cron while it is already running.
Or the cron was completed immediately after u input the cron.php url in browser. Continue reading Drupal – Cron Failure
Drupal – Add CSS Attributes to Menu Items
If you want to add customized the HTML attributes such as id and class of the menu items, the Menu attributes module could help.
Download and install the module @ Drupal – Menu attributes Continue reading Drupal – Add CSS Attributes to Menu Items
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