Thursday, January 23, 2014

Drupal Basic

Nodes
Content types in Drupal are derived from a single base type referred to as a node. Whether it’s a blog
entry, a recipe, or even a project task, the underlying data structure is the same. The genius behind this
approach is in its extensibility. Module developers can add features like ratings, comments, file
attachments, geolocation information, and so forth for nodes in general without worrying about whether
the node type is blog, recipe, or so on. The site administrator can then mix and match functionality by
content type. For example, the administrator may choose to enable comments on blogs but not recipes
or enable file uploads for project tasks only.
Nodes also contain a base set of behavioral properties that all other content types inherit. Any node
can be promoted to the front page of the web site, published or unpublished, or even searched. And
because of this uniform structure, the administrative interface is able to offer a batch editing screen for
working with nodes.

Fields
Content in Drupal is composed of individual fields. A node title is a field, as is the node body. You can
use fields in Drupal to construct any content type that you can think of—for example, an Event. If you
think about an Event, it typically contains a title, a description (or body), a start date, a start time, a
duration, a location, and possibly a link to register for the event. Each of those elements represents a
field. In Drupal we have the ability to create content types using fields—either programmatically by
creating a module, or through the Drupal administrative interface by creating a new content type and
assigning fields through the user interface. The great news is that the Field API makes it extremely easy
to create simple to complex content types with very little programming.

Blocks
A block is information that can be enabled or disabled in a specific location on your web site’s template.
For example, a block might display the number of current active users on your site. You might have a
block containing links to the most popular content on the site, or a list of upcoming events. Blocks are
typically placed in a template’s sidebar, header, or footer. Blocks can be set to display on nodes of a
certain type, only on the front page, or according to other criteria.
Often blocks are used to present information that is customized to the current user. For example,
the user block contains only links to the administrative areas of the site to which the current user has
access, such as the “My account” page. Regions where blocks may appear (such as the header, footer, or
right or left sidebar) are defined in a site’s theme; placement and visibility of blocks within those regions
is managed through the web-based administrative interface.

No comments: