1 |
e5e66f93
|
Assos Assos
|
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 |
85ad3d82
|
Assos Assos
|
|
7 |
e5e66f93
|
Assos Assos
|
Panelizer is a descendent and replacement for the "Panel Nodes" module bundled
|
8 |
|
|
with Panels; no upgrade path is available as of yet.
|
9 |
85ad3d82
|
Assos Assos
|
|
10 |
|
|
|
11 |
e5e66f93
|
Assos Assos
|
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 |
85ad3d82
|
Assos Assos
|
|
16 |
e5e66f93
|
Assos Assos
|
* Can be easily extended to support additional entities, e.g. Fieldable Panels
|
17 |
|
|
Panes [2] and Bean [3] includes full support.
|
18 |
85ad3d82
|
Assos Assos
|
|
19 |
e5e66f93
|
Assos Assos
|
* Each entity bundle (content type, vocabulary, etc) may have each view mode
|
20 |
|
|
configured individually, allowing for each to be tailored separately.
|
21 |
85ad3d82
|
Assos Assos
|
|
22 |
e5e66f93
|
Assos Assos
|
* 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 |
85ad3d82
|
Assos Assos
|
|
26 |
e5e66f93
|
Assos Assos
|
* Each entity bundle / view mode combination may its default display controlled.
|
27 |
85ad3d82
|
Assos Assos
|
|
28 |
e5e66f93
|
Assos Assos
|
* 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 |
2545992a
|
Assos Assos
|
Panels v7.x-3.6 or newer.
|
36 |
e5e66f93
|
Assos Assos
|
|
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 |
85ad3d82
|
Assos Assos
|
|
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 |
e5e66f93
|
Assos Assos
|
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 |
85ad3d82
|
Assos Assos
|
|
59 |
|
|
- With Default, No Choice
|
60 |
e5e66f93
|
Assos Assos
|
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 |
85ad3d82
|
Assos Assos
|
"No Panel". When a panel has been chosen, users with permission can then
|
69 |
e5e66f93
|
Assos Assos
|
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 |
85ad3d82
|
Assos Assos
|
|
74 |
e5e66f93
|
Assos Assos
|
- With Default, With Choice
|
75 |
85ad3d82
|
Assos Assos
|
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 |
e5e66f93
|
Assos Assos
|
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 |
85ad3d82
|
Assos Assos
|
|
81 |
|
|
|
82 |
e5e66f93
|
Assos Assos
|
Entity View Modes
|
83 |
|
|
--------------------------------------------------------------------------------
|
84 |
85ad3d82
|
Assos Assos
|
Panelizer will allow you panelize each view mode individually. One view mode,
|
85 |
e5e66f93
|
Assos Assos
|
the "Full page override" is not actually a view mode - it uses Page Manager to
|
86 |
85ad3d82
|
Assos Assos
|
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 |
e5e66f93
|
Assos Assos
|
will not appear in the Default view mode but it will appear in the Full Page
|
92 |
|
|
Override.
|
93 |
85ad3d82
|
Assos Assos
|
|
94 |
|
|
|
95 |
e5e66f93
|
Assos Assos
|
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 |
85ad3d82
|
Assos Assos
|
|
103 |
|
|
|
104 |
e5e66f93
|
Assos Assos
|
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 |
85ad3d82
|
Assos Assos
|
|
112 |
|
|
Panelizer 7.x-3.x is Revision Aware. This has the downside that duplicating
|
113 |
e5e66f93
|
Assos Assos
|
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 |
85ad3d82
|
Assos Assos
|
|
116 |
|
|
|
117 |
e5e66f93
|
Assos Assos
|
API
|
118 |
|
|
--------------------------------------------------------------------------------
|
119 |
85ad3d82
|
Assos Assos
|
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 |
e5e66f93
|
Assos Assos
|
type. The easiest way to add Panelizer support for a custom entity is to copy
|
122 |
|
|
the node entity.
|
123 |
85ad3d82
|
Assos Assos
|
|
124 |
|
|
As a CTools plugin, you will be required to implement
|
125 |
e5e66f93
|
Assos Assos
|
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 |
85ad3d82
|
Assos Assos
|
|
130 |
e5e66f93
|
Assos Assos
|
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 |
85ad3d82
|
Assos Assos
|
information.
|
133 |
|
|
|
134 |
e5e66f93
|
Assos Assos
|
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 |
85ad3d82
|
Assos Assos
|
|
161 |
e5e66f93
|
Assos Assos
|
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/ |