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;

Downloads

Version Downloads Date Links
6.x-1.0 tar.gz (6.86 KB) | zip (7.32 KB) 2009-Feb-10 Notes

Project Information


Maintainers for Dynamic Field

  • sourcen - 1 commit
    last: 2 years ago, first: 2 years ago

Issues for Dynamic Field

To avoid duplicates, please search before submitting a new issue.
All issues
Bug reports
Oldest open issue: 10 Feb 09
nobody click here