1
|
Diff module - http://drupal.org/project/diff
|
2
|
============================================
|
3
|
|
4
|
Diff enhances usage of node revisions by adding the following features:
|
5
|
|
6
|
- Diff between node revisions on the 'Revisions' tab to view all the changes
|
7
|
between any two revisions of a node.
|
8
|
- Highlight changes inline while viewing a node to quickly see color-coded
|
9
|
additions, changes, and deletions.
|
10
|
- Preview changes as a diff before updating a node.
|
11
|
|
12
|
It is also an API to compare any entities although this functionality is not
|
13
|
exposed by the core Diff module.
|
14
|
|
15
|
REQUIREMENTS
|
16
|
------------
|
17
|
Drupal 7.x
|
18
|
|
19
|
INSTALLATION
|
20
|
------------
|
21
|
1. Place the Diff module into your modules directory.
|
22
|
This is normally the "sites/all/modules" directory.
|
23
|
|
24
|
2. Go to admin/build/modules. Enable the module.
|
25
|
The Diff modules is found in the Other section.
|
26
|
|
27
|
Read more about installing modules at http://drupal.org/node/70151
|
28
|
|
29
|
See the configuration section below.
|
30
|
|
31
|
UPGRADING
|
32
|
---------
|
33
|
Any updates should be automatic. Just remember to run update.php!
|
34
|
|
35
|
CONFIGURATION
|
36
|
-------------
|
37
|
|
38
|
Unlike the earlier version, the module now has a lot of configurable settings.
|
39
|
|
40
|
Global settings can be found under Configuration > Content > Diff
|
41
|
|
42
|
i.e. http://www.example.com/admin/config/content/diff
|
43
|
|
44
|
Entity specific settings would be listed under the entities settings. This
|
45
|
module only handles Node revisioning functionality, and these are detailed
|
46
|
below.
|
47
|
|
48
|
1) Node revisioning settings
|
49
|
|
50
|
Diff needs to be configured to be used with specific node types on your site.
|
51
|
To enable any of Diff's options on a content type's settings page.
|
52
|
|
53
|
e.g. http://www.example.com/admin/structure/types/manage/page
|
54
|
|
55
|
a) Diff options
|
56
|
|
57
|
Under "Compare revisions", enable the settings that you want;
|
58
|
|
59
|
i) "Show View changes button on node edit form" adds a new "Preview" like
|
60
|
submit button to node editing pages. This shows a diff preview.
|
61
|
|
62
|
ii) "Enable the Revisions page for this content type" adds the revisioning
|
63
|
tab to content. This allows users to compare between various revisions
|
64
|
that they have access to.
|
65
|
|
66
|
iii) "Standard comparison preview" option allows you to control how the most
|
67
|
current revision is show on the revision comparision page.
|
68
|
|
69
|
b) Publishing options
|
70
|
|
71
|
It is strongly advised that you also enable the automatic creation of
|
72
|
revisions on any content types you want to use this with. If you do not do
|
73
|
this, chances are there will be limited revisioning information available to
|
74
|
compare.
|
75
|
|
76
|
Under "Publishing options", enable "Create new revision".
|
77
|
|
78
|
2) Field revisioning settings
|
79
|
|
80
|
Global settings per field type can be found here:
|
81
|
|
82
|
http://www.example.com/admin/config/content/diff/fields
|
83
|
|
84
|
"Show field title" toggles field title visibility on the comparison page.
|
85
|
|
86
|
"Markdown callback" is the callback used to render the field when viewing the
|
87
|
page in the "Marked down" page view.
|
88
|
|
89
|
"Line counter" is an optional. This shows the approximate line number where
|
90
|
the change occurred. This is an approximate counter only.
|
91
|
|
92
|
Other fields add additional settings here.
|
93
|
|
94
|
3) Entity revisioning settings
|
95
|
|
96
|
Global configurable settings limited to node entities.
|
97
|
|
98
|
a) Show entity label header
|
99
|
|
100
|
This provides a field like title for the entity label field.
|
101
|
|
102
|
i.e. For nodes, this provides a header for the node's title.
|
103
|
|
104
|
b) Treat diff pages as administrative
|
105
|
|
106
|
By default, the revisioning pages are administrative, i.e. they will use the
|
107
|
administration theme. You can block this by unchecking this option.
|
108
|
|
109
|
4) Global settings
|
110
|
|
111
|
A small number of new features have been added to the 7.x-3.x branch, these
|
112
|
include the ability to change the leading and trailing lines in the comparison,
|
113
|
a new CSS theme for the diff pages, new JScript options for the revisioning
|
114
|
selection form and options to help prevent cross operating systems in relation
|
115
|
to line endings.
|
116
|
|
117
|
http://www.example.com/admin/config/content/diff
|
118
|
|
119
|
Technical
|
120
|
---------
|
121
|
- Diff compares the raw data, not the filtered output, making it easier to see
|
122
|
changes to HTML entities, etc.
|
123
|
- The diff engine itself is a GPL'ed php diff engine from phpwiki.
|
124
|
|
125
|
API
|
126
|
---
|
127
|
See diff.api.php
|
128
|
|
129
|
Maintainers
|
130
|
-----------
|
131
|
- realityloop (Brian Gilbert)
|
132
|
- Alan D. (Alan Davison)
|
133
|
- dww (Derek Wright)
|
134
|
- moshe (Moshe Weitzman)
|
135
|
- rötzi (Julian)
|
136
|
- yhahn (Young Hahn)
|