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...
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.
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;
This project is sponsored by SourceN. We provide specialist consulting services in Enterprise Drupal, Views & Panels, Visit us at www.sourcen.com or Contact us.
- Maintenance status: Actively maintained
- Development status: Under active development
- Module categories: Content Construction Kit (CCK)
- Reported installs: 301 sites currently report using this module. View usage statistics.
- Downloads: 4,488
- Last modified: December 1, 2014
- Stable releases receive coverage from the Drupal Security Team.
Look for the shield icon below.