Umesh Patil

How to enable mod_rewrite Module on Ubuntu in Apache for Drupal

To enable clean, go to http://localhost/yourDrupalProject/?q=admin/config/search/clean-urls.
Take clean URL test, if it fails then follow these instruction,
 
    1. Open  terminal and typin "a2enmod rewrite" , It will enable your mod_rewrite module for Apache.
    2. Then go to "/etc/apache2/sites-available" and edit default file.(For this you must have writable permissions to this file and sites-available folder.)
    3. Replace below with existing lines 4 to 14&n

Insert a block into a node or template in Drupal 7

To print the block you can use below code,

$addblock = module_invoke('addthis','block_view','addthis_block');
print render($addblock['content']);

addthis = "module_name" = This is module name can be found in block configuration URL or the name of the module's folder

block_view = Type of view

addthis_block = "block_delta" = This can also be found in the block configuration URL

*Configuration URL = Open blocks page in Drupal 7 which is "admin/structure/blocks", and click on "configure".