Tag Archives: Drupal 7

Drupal 7 – Update the module schema by hook_update_N()

Recently i start working on BeansTag again as some users request to add the meta robots and canonical options.

This time, the update involves a change in the module schema. In this case, we need to implement the hook_update_N() in .install.

The following piece of code is added to beanstag.install. Continue reading Drupal 7 – Update the module schema by hook_update_N()

Drupal 7 – Get the prev and next node ID using Previous/Next API

For developers, the Flippy module which i mentioned might be not flexible enough.
Drupal 7 – Display Previous and Next node links on node view using Flippy module

Then you could consider another module called Previous/Next API. With this module, you can add the previous and next node links in any preprocess functions, template.php or module files using the API functions provided by this module.

Another advantage is that it caches all the links in its own database table which could speed up the query and this also reduces the database loading. Let’s see how this module work.
Continue reading Drupal 7 – Get the prev and next node ID using Previous/Next API

Drupal 7 – Core drag and drop not working

One day after i migrated a Drupal 7 website to a client’s server, the core drag and drop feature did not work. In addition, i could not edit the Context because nothing was shown when i select the condition. The Show row weights link was also missing.

Finally i found that i was not the only one who came across this problem. The following post is a similar scenario and probably the failure was caused by the PHP 5.3 on the client’s server.
Drupal Core – Drag and drop not working
 

Anyway, after i have enabled the Aggregate JavaScript files in Administration » Configuration » Development » Performance, the problem was gone.

Done =)

Drupal 7 – Apply sticky footer in Omega theme

We can make the section-footer sticky in Omega theme by adding the following piece of code in <your-theme>-alpha-default.css.

/* sticky footer */
html, body {height: 100%; margin: 0;}
#page {display: table; width: 100%;}
html>/**/body #page {height: 100%;}
*:first-child+html #page {height: auto;}
.section {display: table-row;}
html>/**/body .section-content {height: 100%;}
*:first-child+html body .section-content {height: auto;}

 

Kudos to Karl Kasischke.

Done =)

Reference: Has anyone tried to get a sticky footer to work with Omega?

New Relic – Enable Drupal module monitoring

New Relic supports the following list of PHP frameworks.

  • Drupal 6 and 7
  • WordPress
  • CakePHP 1.2, 1.3 and 2.*
  • CodeIgniter 2
  • QDrupal
  • Joomla 1.5 and 1.6
  • Symfony 1
  • Yii
  • Zend Framework 1
  • Magento 1.5 and 1.6
  • MediaWiki
  • Kohana

If you are monitoring a Drupal website, you will find the module tab on the Application menu.

Continue reading New Relic – Enable Drupal module monitoring