Thursday, July 7, 2011

Tutorial for view Module

How to work with drupal view

What is Views

The Views module provides a flexible method for Drupal site designers to control how lists and tables of content (nodes in Views 1, almost anything in Views 2) are presented. Traditionally, Drupal has hard-coded most of this, particularly in how taxonomy and tracker lists are formatted.

This tool is essentially a smart query builder that, given enough information, can build the proper query, execute it, and display the results. It has four modes, plus a special mode, and provides an impressive amount of functionality from these modes.
Among other things, Views can be used to generate reports, create summaries, and display collections of images and other content.

You need Views if

  • You like the default front page view, but you find you want to sort it differently.
  • You like the default taxonomy/term view, but you find you want to sort it differently; for example, alphabetically.
  • You use /tracker, but you want to restrict it to posts of a certain type.
  • You like the idea of the 'article' module, but it doesn't display articles the way you like.
  • You want a way to display a block with the 5 most recent posts of some particular type.
  • You want to provide 'unread forum posts'.
  • You want a monthly archive similar to the typical Movable Type/Wordpress archives that displays a link to the in the form of "Month, YYYY (X)" where X is the number of posts that month, and displays them in a block. The links lead to a simple list of posts for that month.
Views can do a lot more than that, but those are some of the obvious uses of Views.



This screencast covers the installation and configuration of the views module, as well as:
  • Creating a new view (both page and block)
  • Adding arguments to the url for a page view
  • Using views to create an RSS feed
  • Using fields to customize the layout of list and table views
  • Overview of filters and exposed filters
  • Basic Performance considerations of views
This is the script for the screencast:

Install

This screen cast is going to teach you the basics of using the views module in drupal. First we have to download the views module. To do this, go tohttp://www.drupal.org/project/views and click on download.
Once the download is complete, extract the views module.
Once the extraction is finished, move the files into the modules folder.

Configuration of the Views Module

To configure views, go to the modules page, scroll down, and make sure that all the views components are enabled. Once everything is working as it should, there should be an extra tab under site building - views.

Creating a View

Say i want to create a blog replica using views. To do this, go to views, and click add. Enter a name. Because this is going to be a page and not a block, I have to select 'provide page view' under page. Enter a url and a title as you see fit. Because I want the most recent posts to come first, I have to add a particular sort criteria - node created time, and change the default sorting to descending.

Build first application with drupal

As a php programmer installing drupal is not a big deal . is it ?  Now what ?
Let move in by making a website for giving informatoin about company , correct ..
so what you think what should be in basic website for giving informatin about any comapny.according to me there should be 5 ,6 page about company infomation , 1 contact form , company logo , google map for company location
SO let start step by step
1) Enable some of needed module profile , path , taxonomy , search ,php filter
2) start with adding content admin /node/add/page
Put tile in tile label Title: * - Hello welcom to anshul.com

next - put description of your company in content area.
In drupal there are 3 types of default filter available for
content called as "Input format"   a) Filtered HTML b)Full HTML    c) PHP code

In our case we should choose full HTML to make content more beautiful and to be rich text format.
(Note- you can use http://drupal.org/project/fckeditor )

for wysiwyg editor
3) make a menu setting if you want this content to be display on click of menu put a menu name at menu setting

4)Comment setting - Put comment setting acording to content . for our website we are making this first content for front page so we will not allow user to comment

5) Remember path setting option only come when you enable path module from drupal admin

save the page ,wow we have page ready :) without hassel!! we have menu created with search engine optimized url great.. Thanks to drupal

now for contact us page
a)Enable core module "contact" from drupal module
b) add category /admin/build/contact/add
put the required information like email email, autoreply message etc


c) now add the permission to contact form >user managemnt -> permission
/admin/user/permissions
allow which type of users you want to the contact form should access
d) contact form is ready now
www.yourdomain.com/contact

you never get this easiyness of contact form in any CMS
E) Now make a menu admin/build/menu
 ->add new menu item /admin/build/menu/add
  - url of page
- title of menu

 for google Map on contact us page
Download http://drupal.org/project/gmap this contributed module enable it from admin

Please view this video for moore detail

Google map in content
After view on the above video it is very complicate to insert goolge map inside yout content . but relax we have the gmap macro builder to convert worries into hurry.
download GMAP macro builder. make a macro code
Use the online GMap macro builder to design your map and copy the generated macro text to the clipboard.

eg -

Map
Satellite
Hybrid
next step is
Go to your input formats page and select "Full HTML" as default input format. Configure the "Full HTML" input format, select "GMap filter" and click on the "Save configuration" button.
Now
insert this code inside the  content -> Select full html as a filter
You will see the result page contains the gmap inside the

Easy drupal tutor

Drupal is a opensource content management system which has following advantages over other cms



Reliable and robust: Are there a lot of bugs in the code? Will it affect my site
if I have to forever add patches or obtain updates for faulty code?
Efficient: Does the code use my server's resources wisely? Am I likely to run
into concurrency problems, or speed issues early on?
Flexible: If I change my mind about what I want from my site, will I be able
to implement those changes without redoing everything from scratch?