Compatibility:

Categories:

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.

Note that Token module doesn't provide any visible functions to the user on its own, it just provides token handling services for other modules.

For Drupal 6, the Token module provides a "Token Actions" module which can be enabled separately. This provides several "actions" for the Drupal core Actions/Trigger modules to use that take advantage of the Token replacement functionality.

Modules that use the Token module and provide tokens via the API include Organic Groups, Pathauto, Comment Notify, and Commerce.

The basic token API is now a part of Drupal 7! Unfortunately, other things like the a browsable token UI, and field & profile tokens did not make it into core and will be supported here for Drupal 7.

Compatibility:

Categories:

This module allows the admin account (user 1) to add fields, filters and sorts to views which use PHP code. It also supports additional accounts when the core PHP Filter module is enabled.

This is the successor of Views Custom Field for both D6 and D7. The D6 version supports both Views 2 and Views 3.

Note

While this module allows you to directly use PHP inside views which may be useful for quick and easy solutions, it is highly advisable to use regular handlers and plugins when available (or even to create one yourself). Take note that filtering and sorting a view using PHP always has a considerable perfomance impact.

Alternatives

An alternative to this module is Computed field. It lets you add an actual field to your entities where you specify the PHP code you'd like to run. You can store the computed result in the database or have it run on the fly when viewed directly or through Views. It also lets you implement hooks in your own modules which hold your computation code so it can be version controlled. Views PHP doesn't have this ability, but there's a feature request for this over at #1326780: Provide function templates for code to use instead of text areas.

There is a lot of overlap with Computed Field (which is easier if your focus is on generating content for fields, rather than Views support).

Compatibility:

Categories:

Computed Field is a very powerful field module that lets you add a custom "computed fields" to your content types. These computed fields are populated with values that you define via PHP code. You may draw on anything available to Drupal, including other fields, the current user, database tables, you name it. (Feeling the power yet? :) ) You can also choose whether to store your computed field values in the database with other content fields, or have them "calculated" on the fly during node views. (Although you should note that Views use requires database stored values.) This field is literally the Swiss Army knife of fields. So start cooking up your PHP based values!

It is important to read that documentation to be able to use this filter fully. It is powerful!

This is an extremely powerful input filter with a huge number of options and applications, but if you just want to insert the content of one node into another Node Embed suffices, and has a Drupal7 version.

Compatibility:

Categories:

Have you ever wanted to include the rendering of node within the content of another node? For example, embedding an Image/Slideshow/Video node within the body of an Article node. Or the embedding of an Author node as a bio block within a blog posting? Node Embed allows you to do that.

Node Embed provides an input filter for CKEditor & FCKEditor integration allowing a content editor the ability to embed the rendering of nodes within the body/fields of another node. This uses a View to allow for the browsing/preview/selection of a node to embed and provides a set of template suggestions that allow for the detailed control of node rendering when in embedded mode.

Compatibility:

Categories:

Insert View is a filter that allows users to embed content lists generated by the Views module into node bodies and blocks using relatively simple tag syntax.

Why would you want to use an Insert View tag when you could just invoke a view using PHP? Simple. When you want to allow users to insert views or edit content on a page with an inserted view without granting them permission to use PHP.

The tag syntax is:

</b>
The parameters are: view name, view display id, view arguments.
Valid examples:
is replaced by the content listing.
invokes the view using the specified display.
invokes the view using the specified display and passes arg1, arg2 and arg3 to the view.
passes arg1 to the view and will use the "default" display set for the view.

Compatibility:

Categories:

Dynamic Field is a CCK field that returns a textarea where you can enter custom PHP code. The code is computed real-time and lets you access Drupal objects like $node, $user...

Note:

This is not a duplicate of ComputedField! ComputedField computes and saves the value in the database when the node is created but Dynamic Field doesn't store the computed value...it computes the php whenever the node is rendered in the theme.

Usage:

All you need to do is place the PHP directly into the CCK field without the <? ?> tag.

Below is an example to return the Node ID:

$nid = $node->nid;
return $nid;

Another example to return the Content Type:

$ntype = $node->type;
return $ntype;

Very handy. Can also be used to create "static" text fields ! But not yet for Drupal7 !. For a Drupal7 compatible equivalent, see instead Computed Field.

Webel for Drupal !

This educational site is brought to you by Webel IT Australia, experts in database-driven web technology for industry, engineering, education and science. Webel is one of Australia's most experienced Drupal CMS web site specialists.

Please donate to the OOE project !

The OOE module is the start of something very big, a completely object-oriented, IDE-friendly module development system for Drupal7, which encapsulates forever the complexity of "by convention" structured Drupal arrays in Classes. If you are a fan of object-orientation, and if you believe there is a better way for Drupal, then please help sponsor this groundbreaking project through a donation.