| 1 |
This module helps organize a group of postings into a publication, such as
|
| 2 |
a newspaper, magazine or newsletter. Each publication can have multiple
|
| 3 |
editions, ordered by publication date, volume and edition number, e.g.,
|
| 4 |
"Daily News, March 3, 2005, volume 4, number 3."
|
| 5 |
|
| 6 |
== CREATING AND ADMINISTERING PUBLICATIONS ==
|
| 7 |
|
| 8 |
The epublish module deals with three objects, which can be
|
| 9 |
created or edited using admin/epublish:
|
| 10 |
|
| 11 |
* A "publication" could be a newsletter or magazine -- something that
|
| 12 |
appears in multiple editions, either on a regular or sporadic basis.
|
| 13 |
|
| 14 |
* "Editions" consist of a single edition of a publication, typically
|
| 15 |
labeled with a dateline, volume and number. A monthly magazine, for
|
| 16 |
example, might be labeled "November 2004, volume 3, number 11." (The
|
| 17 |
volume and number fields are optional.) Each publication can have a
|
| 18 |
designated "current" edition. The current edition will display in
|
| 19 |
all places where a publication is specified but no specific edition
|
| 20 |
number has otherwise been indicated. Each edition can be associated
|
| 21 |
with a list of the postings for that edition. A path can also be
|
| 22 |
entered for each edition, giving the URL to a downloadable non-HTML
|
| 23 |
version of the edition, such as a PDF document.
|
| 24 |
|
| 25 |
* Within each edition, content can be organized using a headlines
|
| 26 |
"section." Headlines sections organize postings by topic using
|
| 27 |
taxonomy terms, similar to the way that news websites such as the
|
| 28 |
New York Times categorize their content using topics such as
|
| 29 |
"international," "national," "sports," etc. In addition to topics
|
| 30 |
based on taxonomy terms, two special, non-taxonomy-based topic
|
| 31 |
groupings exist: "top stories" and "miscellaneous."
|
| 32 |
|
| 33 |
Users with permission to administer publications can use
|
| 34 |
"admin/epublish" to create new editions of a publication and to
|
| 35 |
add or organize the list of nodes associated with each edition. (Each
|
| 36 |
node appears as a separate headline in edition listings.) Weight can
|
| 37 |
be used to control the order in which headlines appear.
|
| 38 |
|
| 39 |
== VIEWING PUBLICATIONS ==
|
| 40 |
|
| 41 |
A list of publications can be viewed at path "epublish". Each publication
|
| 42 |
has a unique numeric publication ID (pid). An individual publication can be
|
| 43 |
using the path "epublish/{pid}" where {pid} is the publication's ID number,
|
| 44 |
or at "epublish\{name}" where {name} is the publication name. An
|
| 45 |
individual edition can be viewed using the path "epublish/{pid}/{eid}" or
|
| 46 |
"epublish/{name}/{eid}" where {eid} is the edition ID number. As an
|
| 47 |
alternative to {eid}, the path can also specify editions by their volume
|
| 48 |
and number using the syntax "v{volume}n{number}". For example, the path
|
| 49 |
"epublish/Monthly%20News/v3n14" would show volume 3, number 14 of the
|
| 50 |
publication named "Monthly News." Or, the path "epublish/4/v3" would
|
| 51 |
list all editions of volume 3 of the publication with {pid} 4.
|
| 52 |
|
| 53 |
The path "epublish/{pid}/current" specifies a publication's current
|
| 54 |
edition.
|
| 55 |
|
| 56 |
== VIEWING LATEST HEADLINES ==
|
| 57 |
|
| 58 |
In addition to displaying postings that have been collected into specific
|
| 59 |
editions of a publication, you can also view a list of the most recent
|
| 60 |
postings in each topic section at "epublish/headlines/{sid}" where
|
| 61 |
{sid} is a numeric section ID. "Topics" use taxonomy terms to organize
|
| 62 |
content according to the following rules:
|
| 63 |
|
| 64 |
* When editing the topics in each section, you can set an "automatically-
|
| 65 |
included headlines limit" specifying the maximum number of headlines that
|
| 66 |
should be included for that topic and also set a time frame that limits
|
| 67 |
the search. For example, a time frame of "30 days" means that postings
|
| 68 |
older than that will be ignored. You can also specify which node types
|
| 69 |
are eligible for inclusion.
|
| 70 |
|
| 71 |
* Most topics refer to a taxonomy term and all of its descendants. For
|
| 72 |
example, a taxonomy might include the term "music," with child terms
|
| 73 |
"rock," "classical," "jazz." Nodes that have been tagged with one or
|
| 74 |
more of these terms would be included in the topic "music."
|
| 75 |
|
| 76 |
* In addition, there are two special topics, named "top stories" and
|
| 77 |
"miscellaneous," which do not filter for taxonomy terms at all. "Top
|
| 78 |
stories" are taken from stories that have been marked as "sticky at
|
| 79 |
top of lists". The "miscellaneous" topic appears at the bottom of
|
| 80 |
each section. (If, however, you set its "automatically-included
|
| 81 |
headlines limit" to zero, no miscellanous headlines will be
|
| 82 |
displayed.)
|
| 83 |
|
| 84 |
== PUBLICATIONS AND HEADLINES BLOCKS ==
|
| 85 |
|
| 86 |
The epublish module creates a sidebar block for each section, as
|
| 87 |
well as a "epublish" block that lists all publications. To make
|
| 88 |
blocks visible on your pages, use "admin/blocks".
|
| 89 |
|
| 90 |
== CUSTOMIZING LAYOUTS ==
|
| 91 |
|
| 92 |
The epublish module comes with several standard "layouts" that
|
| 93 |
make it possible to customize the layout of publication pages. The
|
| 94 |
"node views," "one- and two-column" and "regular" layouts are
|
| 95 |
different page layouts for displaying nodes from a single edition.
|
| 96 |
The "simple list of headlines only" layout is used on pages that
|
| 97 |
list multiple editions of a publication.
|
| 98 |
|
| 99 |
The epublish directory includes a file "epublish.css" with
|
| 100 |
some sample CSS style tags written to work with the module's
|
| 101 |
standard layouts. You can add those tags to your existing Drupal
|
| 102 |
theme, or write your own CSS tags to produce a different style.
|
| 103 |
|
| 104 |
You can use "admin/settings/epublish" to select a headlines
|
| 105 |
*layout* and *section* that apply to all publications and their
|
| 106 |
editions. If you check the "custom layouts" or "custom sections"
|
| 107 |
boxes, individual publications and editions can also be assigned
|
| 108 |
their own separate layouts and sections that override the global
|
| 109 |
settings, according to the following order of precedence:
|
| 110 |
|
| 111 |
=== Section selection ===
|
| 112 |
|
| 113 |
* If the _edition_ specifies a custom section, it takes precedence.
|
| 114 |
|
| 115 |
* Otherwise, if the _publication_ specifies a custom section, it
|
| 116 |
takes precedence.
|
| 117 |
|
| 118 |
* Otherwise, the globally-specified section is used.
|
| 119 |
|
| 120 |
=== Layout selection ===
|
| 121 |
|
| 122 |
* If the _section_ specifies a custom layout, it takes precedence.
|
| 123 |
|
| 124 |
* Otherwise, if the _edition_ specifies a custom layout, it
|
| 125 |
takes precedence.
|
| 126 |
|
| 127 |
* Otherwise, if the _publication_ specifies a custom layout, it
|
| 128 |
takes precedence.
|
| 129 |
|
| 130 |
* Otherwise, the globally-specified layout is used.
|
| 131 |
|
| 132 |
The ability to customize layouts and sections provides considerable
|
| 133 |
flexibility for design purposes, but it can can also make
|
| 134 |
administration of publications more complicated. Most users will probably
|
| 135 |
want to leave the "custom layouts" option turned off.
|
| 136 |
|
| 137 |
== CREATING ADDITIONAL LAYOUTS ==
|
| 138 |
|
| 139 |
Existing layouts are also themeable, and additional layouts can be added
|
| 140 |
as needed.
|
| 141 |
|
| 142 |
To create a new layout, add a file to the "modules/epublish" directory
|
| 143 |
with the filename layout_{name}.inc, where {name} is the name of the new
|
| 144 |
layout. The file should begin by setting two variables:
|
| 145 |
|
| 146 |
* $description = a short description of the layout. (This description will
|
| 147 |
appear in pulldown menus generated by form_select).
|
| 148 |
|
| 149 |
* $context = the context in which the layout will be used. Currently two
|
| 150 |
contexts are in use: "page" and "list". "Page" layouts are used to
|
| 151 |
produce HTML that is intended to appear by itself in the main content
|
| 152 |
column of a Drupal page. "List" layouts are used to produce HTML that
|
| 153 |
is intended to appear as a simple listing of node titles within a
|
| 154 |
broader listing of multiple editions of a publication.
|
| 155 |
|
| 156 |
The layout file also needs to define a function
|
| 157 |
|
| 158 |
theme_epublish_layout{name}($topics, params=NULL) {
|
| 159 |
...some code...
|
| 160 |
return $output;
|
| 161 |
}
|
| 162 |
|
| 163 |
where {name} is the name of the layout, $topics is an array of "topic"
|
| 164 |
objects, and $params is an optional associative array of additional
|
| 165 |
parameters. (This exists so the function can be themed to handle
|
| 166 |
whatever values a theme designer wants passed into the layout.)
|
| 167 |
|
| 168 |
Each "topic" object in the $topics array contains the following
|
| 169 |
attributes:
|
| 170 |
|
| 171 |
$topic->tid = a numeric topic ID. The values 0 and -1 correspond to
|
| 172 |
"miscellaneous" and "top stories," respectively. All
|
| 173 |
other values correspond to a taxonomy term with the
|
| 174 |
same numeric term ID.
|
| 175 |
|
| 176 |
$topic->name = the topic name
|
| 177 |
|
| 178 |
$topic->nodes = an array of node IDs for each article associated with
|
| 179 |
the topic
|
| 180 |
|
| 181 |
Typically, the "theme_epublish_layout{name}" function iterates
|
| 182 |
through the list of topics, using logic such as the following:
|
| 183 |
|
| 184 |
foreach ($topics as $topic) {
|
| 185 |
$output .= (do something with $topic->name);
|
| 186 |
foreach ($topic->nodes as $nid) {
|
| 187 |
$node = node_load(array('nid' => $nid));
|
| 188 |
$output .= (do something with $node);
|
| 189 |
}
|
| 190 |
}
|
| 191 |
|