Drupal Blog

Drupal7 - Customize the search form

Here is the code to be used in the theme's template.php file that will override Drupal's search form.
If no template.php is available, just go ahead and create one.


Drush - Short Tips

Quick notes on Drush, while on a Drupal installation folder:

To create an archive of the current Drupal site:
drush archive-dump --destination=/backups/mysite.tar

To restore the files and databases for all sites in the archive.
drush archive-restore /backups/mysite.tar

To create a mysql dump of the current Drupal database:
drush sql-dump --result-file=
/mydb.sql

To drop all tables of the current Drupal database:
drush sql-drop

To import a new db file in the current Drupal database:

Drupal 7: How to check the available variables in a template (tpl) file

There is a very handy php function that allows us to quickly check all the available variables in a tpl file (e.g. html.tpl.php).
Assuming that the devel module is installed, the following line should do the trick:

<?php kpr(get_defined_vars()); ?>

Alternatively, a print_r should work just fine:

Drupal 7: Reset User 1 Password quick and easy using Drush

There are many solutions out there to reset User 1's password in a Drupal 7 website. A really convenient way is to use Drush, to generate a one time login URL - no mails involved. The output would be directly on the console, and it is simple to just copy and paste it in a browser. 
The drush command is the following:
 
drush php-eval 'echo user_pass_reset_url(user_load(1));
 
and once logged in, the password can be easily changed in the user edit screen. 

Drupal 7: How to remove "More information about formatting options" link

The code below goes in your template.php and removes the "More information about formatting options" link.

<?php
/**
 * Remove the comment filters' tips
 */
function MyThemeName_filter_tips($tips, $long = FALSE, $extra = '') {
  return
'';
}
/**
 * Remove the comment filter's more information tips link
 */
function MyThemeName_filter_tips_more_info () {
  return
'';
}
?>

Please remember to clear the cache in order for the changes to trigger.

Recent Comments

Forward by Dries Buytaert, Founder and Project Lead, Drupal; CTO Acquia.

Order now from:

Managing Expectations Podcast with DrupalEasy

Author Interview http://tinyurl.com/8a8nxno

We provide the most Shiny Drupal Bits & Pixels

Since Drupal 4.x

Konordo OÜ
Drupal Services

Reg No. 14623621
VAT ID. EE102121939

Director: Konstantin Ordoulidis

Get in touch

  • Konordo OÜ
  • Sepapaja 6, 15551 Tallinn, Estonia
  • +4917698807355
  • info [at] konordo [dot] com