Showing posts with label drupal. Show all posts
Showing posts with label drupal. Show all posts

Thursday, January 12, 2012

Placing the Contents of a Block in any Location

If you want to embed the contents of a block into a node, a custom block, or a page template, you can use the following snippets.

D6 and earlier:

$block = module_invoke('module_name', 'block', 'view', 'block_delta');
print $block['content'];

D7:

$block = module_invoke('module_name', 'block_view', 'block_delta');
print render($block);

To specify which block from which module, you simply edit the two following variables in the first line:

'module_name' = The machine name of the module (i.e. the module's folder name). This is true for core modules too, so for instance 'search', 'user' and 'comment' would all work here.

'block_delta' = The machine name of the block. You can determine what this is by visiting the block administration page and editing the block.
The URL for editing a webform block, for instance, would be something like:

Drupal 6: admin/build/block/configure/webform/client-block-11
Drupal 7: admin/structure/block/manage/webform/client-block-11/configure

In this example, 'client-block-11' is the block's delta.

Custom blocks will have module name of 'block' and a number for a delta, which you can also find by editing the block.

For More Information Please Click Here

Friday, April 29, 2011

Brief List of Drupal Modules

Hi

Here is the list of Drupal Modules.

http://drupal.org/node/579536

Tuesday, April 26, 2011

Run Cron

Hi

once we installed the Search API Module for search in drupal we need to run the cron so that it will create indexing.
Other wise The search will not give the search results.

Wednesday, February 2, 2011

How to install Drupal with Drush on Windows7

Installing the Drupal with Drush in Windows

Before going to start working on this make sure following things enabled.

Apache Modules
--------------
mod_rewrite

PHP Extensions
--------------
php_curl
php_gd2
php_mysqli


1)Download the following packages from http://gnuwin32.sourceforge.net
click on Packages link.
and Download the Following Packages.
a)libarchieve
b)gzip
c)wget
d)tar

Download all the Packages as setups so that easy to install.

After Downloading four packages install it.

After completion of installation add all the Installed packages to environment variables.
for ex:-
If you installed the packages to C:\Program Files (x86)\GnuWin32 Add the C:\Program Files (x86)\GnuWin32\bin to path in environment variables.

and Add the php and mysql paths to the Path in Global Settings.

Download the Drush from Drupal.org(http://drupal.org/project/drush).

Unzip and place in any folder and add that path to the path variable in environment variables.

Now go to the Command prompt cd to www directory and type "drush" then you will see the entire Help.

That means You have installed the drush Successfully.

Here is a very good video tutorial on Installing WAMP, Drush & Drupal on Windows 7.
(Referred from vimeo.com)


And also Refer
---------------
http://drupal.org/project/drush
http://drush.ws

Here is the site to generate drush-make file quickly.
http://drushmake.me/

Thursday, September 2, 2010

Custom Design for Content type forms in Drupal

Add the Following code in template.php in the theme folder.

function phptemplate_node_form($form) {
  switch ($form['#node']->type) {
    case 'printer': //content_type
    return theme_render_template(path_to_theme().'/printer-form.tpl.php', array('form' => $form));
    default:
     return theme_node_form($form);
      }
}