Advertising sustains the DA. Ads are hidden for members. Join today

Weight - Control node placement

Introduction

The Weight module adds a weight option to enabled node types. Nodes with lower weight will float to the top of lists, while heavier items will sink to the bottom of lists. This is useful for sorting non-chronological nodes like bios, e-commerce products, or whatever you would like and for ordering nodes on the front page.

The "standard" Drupal sort order for nodes is by sticky, then by created date. Weight uses the node table's 'sticky' column to store weights as well as sticky information (so that feature is not lost). So then nodes will be sorted first by stickiness, then by weight, then by creation date.

This is a simple module with a simple purpose that can add a lot of value to your site with very little overhead.

Installation

Standard module installation applies.

Drupal 7.x-2.x

NOTE: Version 3 is used differently. See below for details.

Permissions

assign node weight
Allow modification of node weights.
administer weight
Administer configuration of the weight module.

Menu items

The only menu item is for the settings (see below).

Settings

To enable Weight for a content type, go to Administration » Structure » Content
types and select the content type you want to enable Weight for. Select the Weight
vertical tab, choose your desired settings, and click the Save button.

Setting weights

There are principally two ways of setting a node's weight. The first is when the node is created or
edited. The second is through the Content administration page.

Add / Edit

For enabled content types and users who have the appropriate permission, a fieldset will be added to
the node form for "Weight." Within this fieldset, you will find a selector box for the weight.

Content administration

On the Content administration page (Administration » Content), there will be a "Weight"
column containing a selector box to set the weight of any node with a content type that has been weight enabled.

 

Drupal 7.x-3.x

The module provides a new field type and widget called "weight" that can be added to a content type like any other field.

Drupal 6

Permissions

assign node weight
determines whether or not a user may set a node weight on the Add/Edit screen.

Menu items

The only menu item is for the settings (see below).

Settings

The module administration is at Administer » Site configuration » Weight. Access to this page is controlled with the administer site configuration permission.

Node Weight Range
This sets the range of weights that will be available.
Display On
This selects the content types that will be allowed to use weights.

Setting weights

There are principally two ways of setting a node's weight. The first is when the node is created or edited. The second is through the Content administration page.

Add / Edit

For enabled content types and users who have the appropriate permission, a fieldset will be added to the node form for "Node Weight." Within this fieldset, you will find a selector box for the weight.

Content administration

On the Content administration page (Administer » Content management » Content), the "Operations" column will contain a selector box for the weight of any node with a content type that was selected on the settings page.

Views Integration

The Weight module includes a default view that is disabled by default. This view provides a table of node titles that can be reordered using

Guide maintainers

nancydru's picture