Mywebdunia's Blog

Posts Tagged ‘Drupal

Blocks are nothing but boxes of content, that are displayed in regions such as sidebar or footer on your page.

For creating a block go to Administer >> Block >> Add block, you will find a form fill the details of your block and save it.

Say for Example you have created a block with name Test Block with ID 1. Here’s how you use this code snippet to insert any block

Browse to Site Building >> Blocks >> List Browse over the “configure” link next to your block

This will reveal the following address line (in this example we are using a custom block with ID 1)

/admin/build/block/configure/block/1

the last two variables are the ones we’re interested in: /block/1

Now to place this custom block into a page, we need to just add these code into the PHP code snipped

<?php
$block = module_invoke(‘block‘, ‘block’, ‘view’, 1);
print $block[‘content’];
?>

Note that the middle two terms (‘block’, ‘view’) always stay the same. You’re simply updating the first and last term.

The first term can be a comment, user, event, block or module_name for displaying recent comments, online user, if you have event module installed you can show list of upcoming events or to display a custom block created by Administrator or any module to be displayed respectively.

And the last term “1” indicates the first block. To display 2nd , 3rd, and subsequent user created blocks replace 1, with, 2, 3 etc respectively.

Backing up your Drupal site is now very easy, just need to download and  install the Backup & Migrate Module. To install the module click on the Administer> Modules check the Backup and Migrate module and enable it and save the settings.

Then go to the Administer > Content Management > Backup and Migrate then make the following settings

1. Exclude the following tables altogether: select the table which you dont want to take backup .

2. Give the backup file name.

3. There are also options to compress the file before download, or add a datestamp.

And then click Backup Database.

Backup and Migrate is the easiest module that is available. The other method would be through  PhpMyAdmin.

Drupal is one of the best and Award winning CMS, and one of its best feature is taxonomy.

New users to Drupal can find it bit difficult to understand this feature at first, which even I found it to be difficult for me at first.

Taxonomies are nothing but which allows you classify content into categories and subcategories. Drupal taxonomy is made up of vocabularies and terms. A vocabulary is a set of terms and terms are just another word for categories.

To look more into the Taxonomy, first log into the administrative block of your site. Then click on the Administrative link on the left menu. Find for the taxonomy(which comes under ( Content Management ) link click on that.

Let’s build the taxonomy for a news site as an example. First click on the Add vocabulary tab. Fill all the details into the boxes that is the Vocabulary name, some description, types and hierarchy and save the settings.

The vocabulary has been created, but there are no terms categories in it yet. Click on the Add terms link. Enter the term name, description select the parent and then save the settings. Continue the same procedure for those many terms and vocabularies you need.

For Example this could be the structure:

News [this is the name of your vocabulary]

  • Business
    • Markets
    • Commodities
    • Mutual Funds
  • Cricket
    • Latest
    • Live Cricket
    • Technology

Whenever you develope any CMS based website, the important thing is to have search engine friendly URL’s. Because you might have seen some url’s like http://www.sitename.com/products/pid=23&id=2 such url’s are not search engine freindly most of the search engines doesn’t scan such things. So its better you make your url’s clean like http://www.sitename.com/products/x/y this makes search engine friendly.

To get this with Drupal there are some steps that need to be followed.

1. Assuming that you have alread installed Drupal, enable the Path module to enable this login into your administrative block. Once you are logged in click on Administrative link on the left menu and then click on the Modules link, scroll down the page and find the Path module check on the checkbox left of the module and save the settings.

2. The next step is to check for the clean URL’s  click on the Administrative link on the left menu and then click on Site Configuration and then click on the Clean URLs link  select the Enable radio button and save the settings.

Now go to the front end of your site and point the mouse over a link. In the status bar and in the address bar you will notice that all links will be in clean (human readable) format.

If you are building search-engine-friendly Web sites and want them to be scalable, you should be using a content management system rather than building sites with plain HTML pages or Dreamweaver templates.

Here are few reasons for why CMS(Content Management System) :

1. It generally stores all your content into database.

2. It keeps the site design seperate from your content.

3. Makes it so that to update something on every page of your CMS Web site you generally only have to update it in one place, not on every individual page of the Web site.

These all makes the CMS highly scalable and also allow non-technical users add and edit the content without needing to know any HTML or Web design knowledge.

 

Some example drupal sites that I have generated are:

Some other example of drupal  sites are:

Drupal is one of the strongest open source, the best CMS that I have seen so far. If you are intrested in developing search engine friendly  website with content management system then I suggest you should go for Drupal CMS. 

The following down below are some of the reasons for why drupal.

1. URL Control : Drupal gives you good control of urls. Each item of drupal content called node can be given a custom URL(called a URL alias). In WordPress you are generally limited to one type of permalink URL for all posts. You can also automate custom URL structures for each different content type with the Pathauto Module. The Global Redirect Module will automatically 301 redirect the internal Drupal URL to the custom URL alias. Unlike many other content management systems, Drupal’s content pages have nice clean URLs.

2. Revision Control :  You can configure Drupal to save a new version of your pages every time they are editing. That means that you can go back to view or revert old revisions if you want at any time.

3. Page Titles and Meta Tags :  Drupal’s Page Title Module gives you custom control of your HTML <title> elements, while the Meta Tags Module gives you control over your pages’ individual meta description tags. This is difficult to achieve with other content management systems, but it’s easy with Drupal.

4. Taxonomy :  Drupal has a powerful taxonomy (category) system that allows you to organize and tag content. Each Drupal “vocabulary” (set of categories) can be limited to certain content types. You can also have hierarchical categories, with single or multiple parent categories. Drupal’s advanced taxonomy features, combined with CCK and Views, allows you to easily target all of those long-tail keywords that you researched in Wordtracker. 

5.  User Management  :  Drupal was designed for community-based Web sites and has strong user role and access control functionality. You can create as many custom user roles with custom access levels as you need. For example you could create the following roles, each with different levels of access to your features: “anonymous visitor”, “authenticated user”, “moderator”, “editor”, “webmaster”, “admin”. You can keep the advanced user management features (like multiple blogs) turned off if you don’t want them, enabling them later if your site grows to a point where you would like to add more community features.

6. PHP Template :  Drupal uses the PHP Template theme engine by default. Theming in Drupal is easier than theming in WordPress and doesn’t necessarily require any PHP knowledge.

There are other open-source alternatives to Drupal, but here are a few reasons why I think that Drupal is better:

  • Joomla – It’s not as search engine friendly out of the box as Drupal.
  • Plone – It”s powerful, but Plone is written in Python and has certain server requirements. It is not as easy to extend as Drupal, and it’s harder to find people who know Python than who know PHP. Plone runs on the powerful, but complex, Zope 2.
  • WordPress – WordPress is excellent, but if you need something more heavy-duty or are building a site that you might want to extend in the future you should be considering Drupa

Here is a list of drupal template variables that we commonly use in phptemplate variable page.

1.  $breadcrumb :  HTML for displaying the breadcrumbs at the top of the page.

2. $closure :  Needs to be displayed at the bottom of the page, for any dynamic javascript that needs to be called once the page has already been displayed.

3. $content :  The HTML content generated by Drupal to be displayed.

4. $footer_message : The footer message as defined in the admin settings.

5. $head :  HTML as generated by drupal_get_html_head().

6. $head_title : The text to be displayed in the page title.

7. $title :   Title, different from head_title, as this is just the node title most of the time.

8. $logo :  The path to the logo image, as defined in theme configuration.

9. $mission :  The text of the site mission.

10. $primary_links :  An array containing the links as they have been defined in the phptemplate specific configuration block.

11. $secondary_links :  An array containing the links as they have been defined in the phptemplate specific configuration block.

12. $sidebar_left :  The HTML for the left sidebar.

13. $sidebar_right :  The HTML for the right sidebar.

14. $site :  The name of the site, always filled in.

15. $site_name :  The site name of the site, to be used in the header, empty when display has been disabled.

16. $site_slogan :  The slogan of the site, empty when display has been disabled.

17. $styles :  Required for stylesheet switching to work. This prints out the style tags required.

18. $tabs :  HTML for displaying tabs at the top of the page.

19. $scripts  :  HTML to load the JavaScript files and make the JS settings available. Previously, javascript files are hardcoded into the page.tpl.php.

20.  $base_path:   Returns the base URL path of the Drupal installation. At the very least, this will always default to /.

21. $help :  Dynamic help text, mostly for admin pages.

22. $language :  The language the site is being displayed in.

23. $is_front  :  True if the front page is currently being displayed. Used to toggle the mission.

24. $node :  (5.x and after only) If you are in page.tpl.php displaying a node in full page view then $node is available to your template.

25. $layout :  This setting allows you to style different types of layout (‘none’, ‘left’, ‘right’ or ‘both’) differently, depending on how many sidebars are enabled.

26. $search_box :   True(1) if the search box has been enabled.

These are some of the Drupal Modules that can be of use.
1. Panels Panels allows the website administrator (or sometimes the end-user) to manipulate the layout of individual pages, sidebars, and content pieces, as well as easily dictate what content is displayed in the layout. This module allows you to create pages that are divided into areas of the page. The panels has completely flexible system that includes 2-column, 3-column layouts by default.
To download  http://drupal.org/project/panels

2. Views The Views module provides a flexible method for Drupal site designers to control how lists of content are presented.
To download http://drupal.org/project/views

3. Pathauto The Pathauto module automatically generates path aliases for various kinds of content (nodes, categories, users) without requiring the user to manually specify the path alias.
To download http://drupal.org/project/pathauto

4 TinyMCE TinyMCE adds what-you-see-is-what-you-get (WYSIWYG) html editing to textareas.
To download http://drupal.org/project/tinymce

5. Flickr 1.The module provides a filter for inserting photos and photosets and allows the creation of blocks for rendering a user’s recent photos and photosets.
To download http://drupal.org/project/flickr

6. XML Sitemap XML Sitemap automatically creates a site map that conforms to the sitemaps.org specification. This helps search engines keep their search results up to date. XML sitemap allows us to submit the site map to the major search engines like Ask, Google, Yahoo!, Windows Live.
To download http://drupal.org/project/xmlsitemap

7. Meta tags This module allows you to set some meta tags for each node, view or panels page.
To download http://drupal.org/project/nodewords

8. Gallery This module embeds Gallery2 (http://gallery.menalto.com) inside your Drupal installation to support photos, videos and other content.
To download http://drupal.org/project/gallery

9. Add to Any Share/Save/Bookmark Button Add to Any’s Share/Save widget helps readers share, save, bookmark, and email your pages and stories using any service, such as Delicious, Digg, Facebook, Twitter, and over 100 more social bookmarking and sharing sites. Services are updated automatically.
To download http://drupal.org/project/addtoany

10. CAPTCHA A CAPTCHA is a challenge-response test most often placed within web forms to determine whether the user is human. The purpose of CAPTCHA is to block form submissions from spambots – automated scripts that harvest email address from publicly available web forms.
To download http://drupal.org/project/captcha

11. FAQ The Frequently Asked Questions (faq) module allows users with the ‘administer faq’ permission to create question and answer pairs which they want displayed on the ‘faq’ page. The ‘faq’ page is automatically generated from the FAQ nodes configured.
To download http://drupal.org/project/faq

12. Page Title The page title is the one found in the HTML head inside the tag.
To download http://drupal.org/project/page_title

13. Tell a Friend Module creates a “Tell a Friend” page that allows page viewers to send form e-mails about the site to their friends.
To download http://drupal.org/project/tellafriend

14. Kaltura [Video Module] The Module handles every aspect of video and rich-media functionalities, including transcoding, uploading and importing content, user management and permissions, hosting and streaming on Kaltura’s servers, and even collaborative editing and remixing of content – it’s simple to install, use and customize
To download http://drupal.org/project/kaltura

15. Content Construction Kit (CCK) The Content Construction Kit allows you to add custom fields to nodes using a web browser
To download http://drupal.org/project/cck

16. Token Tokens are small bits of text that can be placed into larger documents via simple placeholders, like %site-name or [user]. The Token module provides a central API for modules to use these tokens, and expose their own token values.
To download http://drupal.org/project/token

17. FeedBurner Integrates Drupal with the services provided by Google FeedBurner. Currently this module provides the means to redirect requests for your site’s feeds to user-specified/created FeedBurner feeds.
To download http://drupal.org/project/feedburner

18. jQuery Update This module facilitates an upgrade of jQuery in Drupal core and allows other contrib modules to rely on a newer jQuery version.
To downlaod http://drupal.org/project/Jquery_update

19. Localizer The Localizer module extends Drupal’s ability to handle human languages. It provides control over a site’s user interface language, the ability to enter and control content in multiple languages, and the ability to display the correct language content needed.
To download http://drupal.org/project/localizer

20. Internationalization Provides content translation -nodes and taxonomy-, interface translation for anonymous users -with the locale module- and browser language detection. Includes a block for language selection and manages translation relationships for nodes and taxonomy terms.
To download http://drupal.org/project/i18n

21. Backup and Migrate  Backup and Migrate simplifies the task of backing up and restoring your Drupal database or migrating data from one Drupal site to another. It supports gzip, bzip and zip compression as well as automatic scheduled backups.

To download http://drupal.org/project/backup_migrate

22. Ubercart is an e-commerce module developed for Drupal. It has been designed with the end user in mind, focusing on usability in three key areas: store configuration, product and catalog creation, and order administration. On the front end, all major systems are configurable and integrate with the standard Drupal systems (node, taxonomy, user, etc.). On the back end, the settings pages and order administration pages have been designed with ease of use in mind, and we are constantly working to lower the barrier to entry for new Ubercart users.

To download http://drupal.org/project/ubercart

23. Google Analytics web statistics tracking system to your website.

To download http://drupal.org/project/google_analytics

24. Administration menu Administration menu module provides a theme-independent administration interface (aka. navigation, back-end) for Drupal. It’s a helper for novice Drupal users coming from other CMS, a real time-saver for Drupal site administrators, and definitely a must for Drupal developers and site builders.

To download http://drupal.org/project/admin_menu

25. GMap The GMap module provides an interface to the Google Maps API within Drupal. It integrates with the Location module to provide users a clickable map for entering latitude and longitude, as well as to display maps of Drupal nodes and users. GMap can be used to create interactive maps with various map markers and content in map bubbles, taking advantage of Drupal’s other content management features. The module also provides a Views display plugin which allows users to display the results of a view on a Google map.

To download http://drupal.org/project/gmap

26. Location The Location module allows real-world geographic locations to be associated with Drupal nodes, including people, places, and other content. The Location module allows admins to collect addresses, geocode them (translate addresses to lattitude/longitude), and associate locations with Drupal nodes and users. Location data is automatically used to generate GeoRSS within your existing RSS feeds. Location also provides an API so that other modules may take advantage of its address storage and geocoding features.

To download http://drupal.org/project/location

27. Image This module allows users with proper permissions to upload images into Drupal. Thumbnails and additional sizes are created automatically.

To download http://drupal.org/project/image

27. Image This module allows users with proper permissions to upload images into Drupal. Thumbnails and additional sizes are created automatically.

To download http://drupal.org/project/image

28. FileField FileField provides a universal file upload field for CCK. It is a robust alternative to core’s Upload module and an absolute must for users uploading a large number of files. Great for managing video and audio files for podcasts on your own site.

To download http://drupal.org/project/filefield

29. Fivestar This module provide voting options for user.

To download http://drupal.org/project/fivestar

30. Voting API VotingAPI helps developers who want to use a standardized API and schema for storing, retrieving, and tabulating votes for Drupal content.

To download http://drupal.org/project/votingapi

31. IMCE is an image/file uploader and browser that supports personal directories and quota.

To download http://drupal.org/project/imce

32. Node clone The clone module allows users to make a copy of an existing item of site content (a node) and then edit that copy. The authorship is set to the current user, the menu and url aliases are reset, and the words “Clone of” are inserted into the title to remind you that you are not editing the original content.

To download http://drupal.org/project/node_clone

33. Backup and Migrate Backup and Migrate simplifies the task of backing up and restoring your Drupal database or copying your database from one Drupal site to another. It supports gzip, bzip and zip compression as well as automatic scheduled backups.

To download http://drupal.org/project/backup_migrate

34. Content Templates (Contemplate) The Content Template (a.k.a. ConTemplate) module allows modification of Drupal’s teaser and body fields using administrator defined templates. These templates use PHP code and all of the node object variables are available for use in the template. An example node object is displayed and it is as simple as clicking on its properties to add them to the current template.

To download http://drupal.org/project/contemplate

35. Printer, e-mail and PDF versions

To download http://drupal.org/project/print

36. Twitter This module provides API integration with the Twitter microblogging service and API-compatible alternatives like Identi.ca.

To download http://drupal.org/project/twitter

37. Frequently Asked Questions The Frequently Asked Questions (faq) module allows users, with appropriate permissions, to create question and answer pairs which they want displayed on the ‘faq’ page. The ‘faq’ page is automatically generated from the FAQ nodes configured.

To download http://drupal.org/project/faq

38. Video Video module allows you to upload video in any format, play video in any format, transcode video to FLV using FFMPEG (can be extended to any transcoder), automatically creates video thumbnails, use video thumbnails in video node teaser, fast and very reliable API for converting videos and auto thumbnailing, can be used as an all-in-one video solution for Drupal.

To download http://drupal.org/project/video

39. 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, Video.

To download http://drupal.org/project/ddblock

40. Contact Forms This module expands the features of the site wide contact form. It eliminates the need for the drop down category menu by generating a clean looking contact form (without a drop down menu) , and a unique path, for each of the contact form categories. You can also define the subject in the link to the form.

To download http://drupal.org/project/contact_forms

Drupal is one of the strongest and toughest CMS. Before knowing about the importing of Joomla to Drupal first we need to know about the terminologies of both.

1. Joomla “Template” is called “Theme” in Drupal.
2. Component = Module.
3. Module = Block.
4. Mambot/Plugin = Input filter.
5. Menu-Horizontal = Primary Links
6. Menu-Vertical = Navigation
7. Dynamic Content Item = Story
8. Static Content = Page
9. Back-end = there is no back-end in Drupal, but modules like Administration Menu that provide a similar interface.
10. SEF = Clean URLs (but some docs refer to SEF, too).
11. Section = Taxonomy Vocabulary/Term
12. Section Title = Taxonomy Term
13. Category = Taxonomy Term
14. Introtext = Teaser
15. Maintext = Body (see explanation below)
16. Pathway = Breadcrumb

Here are some steps for migration of Joomla to Drupal.

1. Transfer all Joomla sections to Drupal categories and transfer all Joomla categories to Drupal terms according to their parents.
2. Copy the Joomla introtext to drupal teaser.
3. Copy the Joomla introtext + maintext to drupal body.

To migrate from Joomla 1.x to Drupal 6.x the following is the procedure.

1. First install Drupal 5.x on the system.
2. Import Joomla Sections and Categories there is a module for migration for Joomla to Drupal 5.x http://drupal.org/project/joomla
3. Upgrade Drupal 5.x to Drupal 6.x before upgrading take a backup of your database and copy the files and sites folder.
3.1 Place the site in offline mode.
3.2 Switch your theme to default garland.
3.3 Disable all custom and contributed module.
3.4 Remove all old files & directory of drupal installation.
3.5 Copy the new version of files.
3.6 Copy the backed up sites & files directory.
3.7 Run the update.php by visiting http://www.abc.com/update.php
3.8 Re-Install all the modules according to the drupal version.


Categories