Projet

Général

Profil

Paste
Télécharger (7,68 ko) Statistiques
| Branche: | Révision:

root / drupal7 / sites / all / modules / panelizer / README.txt @ be58a50c

1
Panelizer
2
---------
3
The Panelizer module allows supported entities to be treated as Panels [1],
4
giving options for different default displays on a per bundle basis. For
5
example, this allows each node display to be customized individually.
6

    
7
Panelizer is a descendent and replacement for the "Panel Nodes" module bundled
8
with Panels; no upgrade path is available as of yet.
9

    
10

    
11
Features
12
--------------------------------------------------------------------------------
13
* Supports all of Drupal core's included entities - nodes, taxonomy terms, users
14
  and comments. (More may be available in the future)
15

    
16
* Can be easily extended to support additional entities, e.g. Fieldable Panels
17
  Panes [2] and Bean [3] includes full support.
18

    
19
* Each entity bundle (content type, vocabulary, etc) may have each view mode
20
  configured individually, allowing for each to be tailored separately.
21

    
22
* Each entity bundle may optionally have multiple displays defined; if this
23
  option is enabled, each entity of that type/bundle will have an option to
24
  select which is used.
25

    
26
* Each entity bundle / view mode combination may its default display controlled.
27

    
28
* Full support for content revisions, and provides integration with both
29
  Revisioning and Workbench Moderation.
30

    
31

    
32
Requirements
33
--------------------------------------------------------------------------------
34
CTools v7.x-1.9 or newer.
35
Panels v7.x-3.6 or newer.
36

    
37

    
38
Configuration & Usage
39
--------------------------------------------------------------------------------
40
Visit Structure >> Panelizer to enable the module for the entities you need;
41
these may also be controlled via the entity bundle's settings page, e.g. for an
42
"Article" content type it may be enabled at the following page:
43
  admin/structure/types/manage/article
44
You may need to visit Site Building >> Pages and enable the appropriate pages
45
for supported entities to use their "Full page override" view mode.
46

    
47
Note that in all cases, modifying Panelizer settings for an entity requires the
48
corresponding 'update' permission for that entity.
49

    
50
Panelizer operates in four basic modes:
51

    
52
- No Default, No Choice
53
  In this mode, the given bundle is panelized, but there is no default panel
54
  associated or selectable. In this case, each entity has a small form on the
55
  "Customize display" tab that says to 'Panelize it!'. When this button is
56
  clicked, a default panel is attached to the entity and the display may then
57
  be customized.
58

    
59
- With Default, No Choice
60
  In this mode, all entities of the given bundle are given the default panel
61
  automatically. Users with appropriate privileges may then customize the panel
62
  for that node. Once customized, the default is no longer applied and changes
63
  to the default will not propagate downstream.
64

    
65
- No Default, With Choice
66
  In this mode, all entities of this bundle will be given a selector to choose
67
  which panel to display on the entity page. The default choice will be
68
  "No Panel". When a panel has been chosen, users with permission can then
69
  customize that panel. Once this is done, the default choice will no longer be
70
  associated with the panel and a choice can no longer be made. The "Reset"
71
  button on the Panelizer settings tab for that entity can return the entity to
72
  a default state and restore the choice.
73

    
74
- With Default, With Choice
75
  Like above, entities will have a selector to choose which panel to use.
76
  However, unlike above, entities that have never made a selection will
77
  automatically be given the default panel. All configured entities will have
78
  some kind of panel, whether it is one of the choices or a customized panel for
79
  that entity.
80

    
81

    
82
Entity View Modes
83
--------------------------------------------------------------------------------
84
Panelizer will allow you panelize each view mode individually. One view mode,
85
the "Full page override" is not actually a view mode - it uses Page Manager to
86
completely override the output of the page the entity is viewed one. This will
87
often conflict somewhat with the Default view mode. It is recommended that you
88
do not panelize both the Default and the Full page override, but instead pick
89
whichever one you think is most needed. The actually difference between the two
90
are quite subtle: Placement of the title is different, and the comment form
91
will not appear in the Default view mode but it will appear in the Full Page
92
Override.
93

    
94

    
95
Permissions
96
--------------------------------------------------------------------------------
97
Once Panelizer is enabled for an entity/bundle combination, it may be necessary
98
to visit People >> Permissions and give users appropriate permissions. All of
99
the Panelizer tabs have their own permission, and if these are revoked it is
100
possible to create panelized entities that can only choose panels but not modify
101
them.
102

    
103

    
104
Known Issues / Caveats
105
--------------------------------------------------------------------------------
106
Panelizer currently uses the Page Manager to render the panelized entities. At
107
this time there is no direct support for view modes. This is a desired feature,
108
though we are somewhat hampered by Drupal only allowing 2 levels of local tasks
109
(tabs) where configuring for multiple view modes really would prefer a third
110
level.
111

    
112
Panelizer 7.x-3.x is Revision Aware. This has the downside that duplicating
113
panels for revisions can generate a lot of extra data. Please keep this in mind
114
-- it may be necessary to periodically clean up older revisions.
115

    
116

    
117
API
118
--------------------------------------------------------------------------------
119
Panelizer 7.x-3.x is constructed on an Object Oriented plugin. There is one
120
plugin per entity type and it MUST be named exactly the same as the entity
121
type. The easiest way to add Panelizer support for a custom entity is to copy
122
the node entity. 
123

    
124
As a CTools plugin, you will be required to implement 
125
hook_ctools_plugin_directory. Then copy node.inc to your plugin directory as
126
MY_ENTITY_TYPE.inc and modify the name of the handler it uses. Copy
127
PanelizerEntityNode.class.php to MyModuleEntityMyEntity.class.php -- and make
128
sure the name of this file matches the handler in your .inc file.
129

    
130
The required implementation pieces are straightforward. You do need to set a
131
flag if the entity supports revisions so that Panelizer can write the
132
information.
133

    
134
If the entity does not support bundles it can only panelize the entire entity.
135

    
136

    
137
Troubleshooting / Known Issues
138
--------------------------------------------------------------------------------
139
* When using older releases of Pathauto it was possible that saving an entity's
140
  overridden Panelizer display (i.e. nodes, etc) would cause the entity's path
141
  alias to be reset. This was a bug in Pathauto prior to v7.x-1.3 and can be
142
  fixed by updating that module to the latest release.
143
* Revisions handling using Workbench Moderation and the Panels IPE (In-Place
144
  Editor) is problematic. This problem is being collaborated on in the following
145
  issue:
146
  https://www.drupal.org/node/2457113
147

    
148

    
149
Credits / Contact
150
--------------------------------------------------------------------------------
151
Currently maintained by Damien McKenna [4]. Originally written by merlinofchaos
152
[5], with many contributions by dww [6] and awebb [7].
153

    
154
Ongoing development is sponsored by Mediacurrent [8].
155

    
156
The best way to contact the author is to submit an issue, be it a support
157
request, a feature request or a bug report, in the project issue queue:
158
  https://www.drupal.org/project/issues/panelizer
159

    
160

    
161
References
162
--------------------------------------------------------------------------------
163
1: https://www.drupal.org/project/panels
164
2: https://www.drupal.org/project/fieldable_panels_panes
165
3: https://www.drupal.org/project/bean
166
4: https://www.drupal.org/u/damienmckenna
167
5: https://www.drupal.org/u/merlinofchaos
168
6: https://www.drupal.org/u/dww
169
7: https://www.drupal.org/u/awebb
170
8: https://www.mediacurrent.com/