Wednesday, 15 April 2015

what is entity in Drupal 7

Answer:- In Drupal 7 each individual node, user, term and comment is now called an entity.
Nodes (content), comments, taxonomy terms and users profiles are now called entity types.

 You can also build new kinds of entity types where the options above don't suit your needs. For more information, read further about using the hook_entity_info and extension by Entity API: entity_crud_hook_entity_info.

In OOP terminology concept of entities is like:
  • An entity type is a base class
  • A bundle is an extended class
  • A field is a class member, property, variable or field instance (depending on your naming preference)
  • An entity is an object or instance of a base or extended class

Bundles

Bundles are an implementation of an entity type to which fields can be attached. You can consider bundles as subtypes of an entity type. With content nodes (an entity type), for example, you can generate bundles (subtypes) like articles, blog posts, or products.

Fields

A field is a reusable piece of content. In technical terms, each field is a primitive data type, with custom validators and widgets for editing and formatters for display.

Entity

An entity would be one instance of a particular entity type such as a comment, taxonomy term or user profile or a bundle such as a blog post, article or product.
You can use entity_load to load any entity. Note, however, that the core does not provide a save or delete function, but thanks to Entity API module the missing pieces are added (entity_create(), entity_save(), entity_delete(), entity_view() and entity_access()).

Difference b/w Drupal 6 concept of nodes and Drupal 7 concept of entities

Imagine that you want to collect more than information when people leave comments. If you want to collect more than name, email and comment, you can add a field. For example, you might want to allow commenters to leave a link to their homepage. Let's assume that is the case for our Article content type.

This was not possible in Drupal 6 with concept of nodes but with Drupal 7 it is in following manner:
  1. Click on Structure in the black admin menu bar
  2. Click on Content types
  3. Click on Manage fields for the Article content type
  4. Observe the tabs shown in the screen shot above.
  5. You have the option to add fields to the content type via the Manage Fields tab and you have the option to add fields to comments via the Comment Fields tab. The fields you add to the Article content type will not automatically apply to comments on other content types.
 In Drupal 6 and before, users and comments didn't have the same power that nodes (content) had. They couldn't have translations, fields, versioning, and so on. It also meant that systems such as Views, which relied on controlling the selection and listing of fields didn’t work as well with comments and users.

what is the Difference between Drupal 6 and Drupal 7

Content Construction Kit (CCK)

Content Construction Kit (CCK) has moved to core in the Drupal 7.
Custom data fields are available to nodes, users, comments and taxonomy terms.
Fields are translatable.

Entity

Entities were introduced in Drupal 7.
An entity would be one instance of a particular entity type such as a comment, taxonomy term or user profile or a bundle such as a blog post, article or product.
You can use entity_load to load any entity. Note, however, that the core does not provide a save or delete function, but thanks to Entity API module the missing pieces are added (entity_create(), entity_save(), entity_delete(), entity_view() and entity_access()).

Security

  • Modules can be updated via the web.
  • More secure log-in system.
  • More secure password system.
  • More secure implementation for scheduled tasks (cron.php).

Update Manager

Introduced an Update manger in Drupal 7 which perform updates directly through the administration interface.

File handling

  • Files are now first class Drupal objects with file_load(), file_save(),and file_validate() functions and corresponding hooks.
  • Files use PHP stream wrappers to enable support for both public and private files and to support pluggable storage mechanisms and access to remote resources (e.g. S3 storage or Flickr photos).
  • Added a field specifically for uploading files, previously provided by the contributed module FileField.

Image handling

  • Improved image handling, including better support for add-on image libraries.
  • Added a field specifically for uploading images, previously provided by the contributed module ImageField.

Search

Improved search support language-aware searches

Database

  • Added query builders for INSERT, UPDATE, DELETE, MERGE, and SELECT queries.
  • Support for master/slave replication, transactions, multi-insert queries,delayed inserts, and other features.
  • Added support for the SQLite database engine.
  • Default to InnoDB engine, rather than MyISAM, on MySQL when available for greater scalability and data integrity.

jQuery

  • Upgraded the core JavaScript library to jQuery version 1.4.2.
  • Upgraded the jQuery Forms library to 2.36.
  • Added jQuery UI 1.8, which allows improvements to Drupal's user experience.

Multisite

Better Support for Multisite Installations

Installer can be run from the command line

Added RDF support

 

what is Drupal weight?

The term Drupal weight is used to describe the priority or order in which the function is processed, or block/ node is displayed.
A heavier (+10) weights will appear lower in lists while a lower weight (-10) will float to the top of lists.

how to add extra fields in druapl registration form

Answer:-Use profile module. In drupal 7 Profile is in core.

How can add the Captcha in registration page for drupal?

Answer:-Use the captcha and recaptcha module.

What is the use of taxonomy and vocabulary in Drupal?

Answer:-Taxonomy, a powerful core module, gives your sites use of the organizational keywords known in other systems as categories, tags, or metadata. It allows you to connect, relate and classify your website’s content. In Drupal, these terms are gathered within “vocabularies.” The Taxonomy module allows you to create, manage and apply those vocabularies.

List the SEO modules available in Drupal.

Answer:-
Pathauto
Nodewords/ Meta tags
Service links
Google analytics
Related Links
Search 404
Site map
Url list