Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
I'm working on a view that displays the body and links for the current and latest (pending) revision.
Content:Body will display the current revision body.
Using Views PHP, I was able to output the link for the pending revision.
Does anyone have any ideas on how I can display the body for the pending revision?
I'd like to have a side by side comparison on one page.
Thanks,
$nid = $row->nid;
$latest_vid = revisioning_get_latest_revision_id($nid);
$current_vid = revisioning_get_current_node_revision_id($nid);
if ($current_vid == $latest_vid) {
echo "<a href='node/$nid/edit'>Edit current</a>";
} else {
echo "<a href='node/$nid/revisions/$latest_vid/compare'>Compare</a>";
}
Comment | File | Size | Author |
---|---|---|---|
#5 | views diff.jpg | 148.9 KB | kingdee40 |
Comments
Comment #1
RdeBoerHi kingdee,
Why not use the Diff module integration that comes with Revisioning?
Rik
Comment #2
kingdee40 CreditAttribution: kingdee40 commentedDiff does a side by side comparison of one revision, I need a side by side comparison of all revisions on one page.
Comment #3
RdeBoerThis is rather crude, but should do the trick:
Rik
Comment #4
RdeBoerComment #5
kingdee40 CreditAttribution: kingdee40 commentedCool, thanks for the help. I kinda wrote my own diff for views display. It's for admin use only so performance isn't my concern. If anyone is interested I'll post the code. It doesn't work as well as the real diff module but I needed a quick visual of all revisions on one page.
This is for views php module:
Comment #6
RdeBoerThat's pretty impressive kingdee!
Comment #7
RdeBoerAdded reference to this issue to the project page. Thanks again kingdee!