I'm relatively new to Drupal, and have no PHP experience so I was wondering if someone could help me out with this.... I need a way to view like a block, a particular field's update that exists in a revised copy of a node.

Currently I'm using the following modules:
1. CCK to create the field
2. Views to create a view block to show the CCK field's (field_sidebar_right_1) contents
3. Revisioning to have a simple workflow and revisioning for content

The desire is to let someone edit a node, including the CCK field. When they save it then it is pending approval by a moderator. I'd like the moderator to be able to click on the revision and see a block containing the cck field (field_sidebar_right_1) in the preview. Currently I can only get it showing the CCK field for the current published node. Instead, I want it to show the revised (unpublished revision) node's field.

I found this argument I'm using currently which shows the published node's field in a block, which I placed as a NID argument in Views:

if (arg(0) == 'node' && is_numeric(arg(1))) {
$node= node_load(arg(1));
if ($node->field_sidebar_right_1) {
$args[0] = arg(1);
}
}
return $args;

Anyone know the solution? Can the argument be changed to pull from the field from the revision URL?

I'm trying to figure this out for a non-profit's needs so would appreciate any help!

Comments

stellrex’s picture

Anyone have any ideas?

Is it as simple as having an argument that combines the node ID and revision IDs and points to that URL? and if so how do you do that?

jguthrie’s picture

I'm not sure if this is the best way to do it, but when viewing a revision you could try something like this:

if (arg(0) == 'node' && is_numeric(arg(1))) {
if (is_numeric(arg(3))) {
$node = node_load(arg(1), arg(3));
} else {
$node = node_load(arg(1));
}