PHP

Wednesday, June 12, 2013

List of some best Drupal slideshows

Slide shows play important part in the website to attract visitors. There are different types of slide show with variety of cool effects. Among a lot of slide show modules i prefer some of these modules.
  1. View Slideshow
    Views Slideshow can be used to create a slideshow of any content (not just images) that can appear in a View. Powered by jQuery, it is heavily customizable: you may choose slideshow settings for each View you create. Click here to view the demo.
  2.  Flex Slideshow
    Flex Slider module integrates the Flex Slider library with Drupal and several contributed modules which allows you to build responsive, resizable slideshows. Try out a DEMO
  3. Dynamic Display block
    Dynamic display block slideshows are mainly used to showcase featured content at a prominent place on the frontpage of the site in an attractive way. A featured content slideshow can contain e.g.: New articles, Most popular content, New products, Portfolios, Videos etc. Click Here for DEMO
  4. Galleria
    This module allows users to create image galleries using the Galleria jQuery plugin, found on http://galleria.aino.se. For demo click here
  5. Image Flow
    This module integrates the ImageFlow plugin with views. It has support for the link field. The customizable onClick function can be used to open links, images, or videos in a colorbox. DEMO


 

Tuesday, June 11, 2013

Drupal 7 Module Install file

While creating a new Drupal 7 module, sometimes we need to interact with database. Moreover, we need to create our own table for the module we are creating. This can be achieved using a .install file. We can create  tables for modules manually using MySQL GUI tools, but if we want to make our module install able in any Drupal 7 intallation server then we should create a .install file.
Below are the steps on how to create a .install file:

  1. Open a text editor, i prefer Notepad++.
  2. Create a new file.
  3. Add your install code in the file, sample code is shown in the screenshot below.
  4. Place the file in the module directory, See here on how to create a simple module.
Now when you install the module form admin module section your table will be automatically created in the database.

Sunday, June 2, 2013

Adding a Contact Us form in Drupal 7

Every website needs a contact us form so that the visitors can easily contact the site owner. In case of Drupal, there is a core (packaged with Drupal installation) contact module. This module is disabled by default. I will explain you how to enable and customize this module in Drupal.

Assuming that you have already installed Drupal in your system or server.

  1. Go to modules section (http://www.sitename.com/admin/modules).


  2. Search for contact (I use Browser's search cntrl+f).
  3. Enable It by clicking the check box before it.
  4. Go to contact configuration section (http://www.sitename.com/admin/structure/contact)
  5. Suppose you want to give your users the choice to select where they want to send their contact details then  you can create contact categories here with separate emails to each categories.
  6. Finally, you need to enable the contact link in the menu.
  7. Go to admin -> structure -> menu (http://www.sitename.com/admin/structure/menu).
  8. By default contact menu is under the navigation and it is disabled.
  9. Edit the menu enable it and you are ready to go....


Thursday, May 30, 2013

Simple Drupal 7 module

Creating a basic Drupal module is not so hard if you have some knowledge of PHP. All you need is some basic ideas on Drupal directory system. All third party modules are stored in /sites/all/modules/modulename folder. So we are going to create a module and place it there. To run a Module you will need two files "modulename.info" and "modulename.module", note modulename is the name of the module you are going to create.




  1. Create a modulename.info file with the following informaiton
    name = modulename
    description = My first module
    core = 7.x
  2. Now create a modulename.module file with the following content
  3. Go to the module section(http://sitename/admin/modules) you will see the module with a check box before it. Check it and click save button down below.
  4. Go to http://sitename/customurl/firstmodule (same url you defined in modulename_menu function) and you should see the page content as "Hello World".







Monday, May 27, 2013

List of Drupal modules you must have

Modules play an important role in developing a Drupal site. Here are the list of some important Drupal modules you need to run a basic site.

  1. Backup & Migrate: This module is specially for developers. This module help to dump database and keep scheduled database backup.
  2. Path Auto: This is one of the best module in Drupal. It is used for automatic path aliasing. It requires Token module to operate. By default Drupal's URL looks like : http://www.site.com?q=node/1, by using Path Auto module this URL can be converted to something like this: http://www.site.com/CUSTOMURL. This URL looks more beautiful than the previous on and even better for Search Engines.
  3. Views: One of the best module in Drupal. This module is used to customize your site's content view sorting, paging, creating content filters,creating pages and blocks and many more. It  requires Chaos Tool Suite module to operate. Suppose you want to create a page where you want to list some articles with paging and sorting feature. To do this, Views module will provide you an interface where you can select articles, create a custom page name to show the list of articles, you can even create a filter to search the articles. You can do this all without a single line of PHP code. 
  4. Captcha: Everybody wants their website's form to be secure. Nobody wants to see the list of spam emails in their inbox. This module works best if you want to control spam in your site's forms. It supports, Math captcha, Re-Captcha and image captcha.
  5. Page Title: It provides us the ability to customize the page title of our Drupal site pages. We can customize the page title using certain tokens or content types. Mostly used for Search Engine Optimization.
  6. IMCE: Best module for uploading, re-sizing, creating thumbnails from images. Provides support for inserting image in textareas. Demo
  7. Google Analytics: Seo Module, it makes easy to insert the google analytic script in our website.
  8. ColorBox: This is a lightbox plugin for jQuery. If you want to display your site's content and images in an overlay or frame then this module is best. Demo