Posts Tagged ‘Drupal’
25
Feb
  • Inoder to create an image gallery in drupal we have to first download two  modules  Images  and  Thick Box.
  • Then goto sites /all/create a folder there called “module” and copy the downloaded modules inside the folder.
  • Goto administer ->module->image and enable every check boxes
  • Also enable thickbox option and save the configuration

More »

, , , , , , , ,

09
Mar

Migrating Drupal from one folder (or one server) to another is not always as simple as just copying the files and database. All the file paths, configuration data, content, menus & structure are stored in the Drupal database. Hence, just a blind copy will break the new Drupal system.

Steps to migrate your drupal installation from on folder to another (or one server to another)

  1. Copy all the files from the current destination to the new destination
  2. Make the database changes in sites/default/settings.php
  3. Browse the new destination and complete the new Drupal installation steps
  4. Login into the Admin area and ensure that the same modules are enabled in both the installations.
  5. Install the ‘Back and Migrate‘ module in the current Drupal installation
  6. Take a backup of the current system and download it. It will be a .mysql file
  7. Install the same ‘Backup and Migrate‘ module in the new Drupal site
  8. Upload the downloaded backup file to the sites/default/files/backup_migrate/manual folder in the destination Drupal site.
  9. Login into the Admin area in the new Drupal and browse
    http://[my-new-drupal-url]/admin/content/backup_migrate/destination/list/files/manual
  10. Here you will see the list of backup files to choose from. Click the ‘Restore‘ link next to the backup file that you just uploaded.

Thats it! Now all your menus, content etc should be imported correctly.

NOTE: Restoring will delete some or all of your data and cannot be undone. Always test your backups on a non-production server!

, ,

18
Feb

Drupal is a free and open source content management system (CMS) written in PHP.It is used as a back-end system for many different types of websites, ranging from small personal blogs to large corporate and political sites, including whitehouse.

The standard release of Drupal, known as Drupal core, contains basic features common to most CMSs. These include the ability to register and maintain individual user accounts within a flexible and rich permission / privilege system, create and manage menus, RSS-feeds, customize page layout, perform logging, and administer the system.

Drupal can run on any computing platform that supports both a web server capable of running PHP and a database (such as MySQL or PostgreSQL) to store content and settings.

Drupal core

Drupal core is the stock installation of Drupal, which can be optionally extended by third party contributions. In Drupal’s default configuration, website content can be contributed by either registered or anonymous users and made accessible to web visitors by a variety of selectable criteria including by date, category, searches, etc.

18
Jan

Found this great post to manage user session auto time-out via Drupal admin area.

http://old.nabble.com/I-am-intersted-in-the-TimeOut-module-tt2800133.html

It was exactly what I was looking for. Nothing fancy. Just specifying the idle session time out for each type of user role. Made a few code tweaks and customized it to work for Drupal 6.x. Simple and effect. Works great for my project and saved me a lot of time!

Please note that the session time out is in seconds!

I have attached the module with this post. Feel free to download and experiment. Let me know your findings too.

sessiontimeout module

,

13
Jan

Open your Drupal project’s sites/all/modules/print/css folder, then open the print.css file, there you can change the format(text color, size, line spacing etc.) of the content.

,

09
Nov

Creating a theme for a form in Drupal 6 is slightly different from Drupal 5.

Steps on how to theme a form in Drupal 6:

  1. Register the theme file.
    Use the hook_theme() function to register the theme for  the form. More information on hook_theme() can be got from here: http://api.drupal.org/api/function/hook_theme

    NOTE: myform1_form and myform2_form are the form ids of the forms you want to theme
    function mymodule_theme()
    {
        $themes = array(
            'myform1_form' => array(
                'arguments' => array('form'),
                'function' => 'mytheme_myform1_form',
            ),
            'myform2_form' => array(
                'arguments' => array('form'),
                'function' => 'mytheme_myform2_form',
            ),
        );
        return( $themes );
    }
  2. Define the callback function. Pass parameters to the theme file and render the file.
    function mytheme_ myform1_form($form)
    {
        drupal_add_css(drupal_get_path('module', 'mymodule') .'/mymodule-form.css');
        drupal_add_js(drupal_get_path('module', 'mymodule') .'/mymodule-form.js');
        return theme_render_template(path_to_theme() . '/mytemplate.tpl.php', array('form' => $form));
    }
    NOTE: It is important to pass the form parameter to the template file as array('form' => $form)
    instead of directly passing $form
    For more information on theme_render_template() check this http://api.drupal.org/api/function/theme_render_template/6
  3. Template file.
    <div class="onelinedd">
        	<div class="onedd">
            	<div class="labels">
     		  <div>Form Field 1</div>
     		  <?php echo drupal_render($form['form_field_1']); ?>
     		</div>
            </div>
        	<div class="onedd">
            	<div class="labels">
     		  <div>Form Field 2</div>
     		  <?php echo drupal_render($form['form_field_2']); ?>
     		</div>
            </div>
        	<div class="onedd">
     	  <?php echo drupal_render($form['submit']); ?>
            </div>
        </div>
  4. Clear cache. Admin -> Site Configuration -> Performance -> Clear Cache

I am sure there must be an better way to do this but, after hours of searching and trying this is what worked for me!

Tips on how to theme a form were taken from these links:

http://agaric.com/note/how-theme-drupal-form

http://drupal.org/node/228189

http://api.drupal.org/api/function/hook_theme

http://api.drupal.org/api/function/theme_render_template/6

, , , , ,