1 |
85ad3d82
|
Assos Assos
|
ABOUT Panelizer 7.x-3.x
|
2 |
|
|
|
3 |
|
|
Panelizer allows you to treat supported entity as panels, giving options
|
4 |
|
|
for different default panels on a per bundle (node type/taxonomy vocabulary)
|
5 |
|
|
basis.
|
6 |
|
|
|
7 |
|
|
Panelizer currently contains support for Node, Taxonomy Term and User
|
8 |
|
|
entities. However, this is constructed as a plugin and more may be available
|
9 |
|
|
in the future.
|
10 |
|
|
|
11 |
|
|
INSTALLING
|
12 |
|
|
|
13 |
|
|
Install this through the normal Drupal method of putting the module in
|
14 |
|
|
sites/all/modules and going to admin/modules to activate it.
|
15 |
|
|
|
16 |
|
|
It requires Panels and Page Manager.
|
17 |
|
|
|
18 |
|
|
INITIAL CONFIGURATION
|
19 |
|
|
|
20 |
|
|
Visit Configuration >> Panelizer to enable the module for the entities you
|
21 |
|
|
need. You may need to visit Site Building >> Pages and enable the appropriate
|
22 |
|
|
pages for supported entities.
|
23 |
|
|
|
24 |
|
|
Note that in all cases, modifying Panelizer settings for an entity requires
|
25 |
|
|
update privileges for that entity.
|
26 |
|
|
|
27 |
|
|
Panelizer operates in four basic modes:
|
28 |
|
|
|
29 |
|
|
- No Default, No Choice
|
30 |
|
|
In this mode, the given bundle is panelized, but there is no default panel
|
31 |
|
|
associated or selectable. In this case, each entity has a small form on
|
32 |
|
|
the Panelizer tab that says to 'Panelize it!'. When this button is clicked,
|
33 |
|
|
a default panel is attached to the entity, and the panel may then be
|
34 |
|
|
customized.
|
35 |
|
|
|
36 |
|
|
- With Default, No Choice
|
37 |
|
|
In this mode, all entities of given bundle are given the default panel
|
38 |
|
|
automatically. Users with appropriate privileges may then customize the
|
39 |
|
|
panel for that node. Once customized, the default is no longer applied
|
40 |
|
|
and changes to the default will not propagate downstream.
|
41 |
|
|
|
42 |
|
|
- No default, With Choice
|
43 |
|
|
In this mode, all entities will be given a selector to choose which
|
44 |
|
|
panel to display on the entity page. The default choice will be
|
45 |
|
|
"No Panel". When a panel has been chosen, users with permission can then
|
46 |
|
|
customize that panel. Once this is done, the default choice will no
|
47 |
|
|
longer be associated with the panel and a choice can no longer be made.
|
48 |
|
|
The "Reset" button on the Panelizer settings tab for that entity can
|
49 |
|
|
return the entity to a default state and restore the choice.
|
50 |
|
|
|
51 |
|
|
- With default, With Choice
|
52 |
|
|
Like above, entities will have a selector to choose which panel to use.
|
53 |
|
|
However, unlike above, entities that have never made a selection will
|
54 |
|
|
automatically be given the default panel. All configured entities will
|
55 |
|
|
have some kind of panel, whether it is one of the choices or a customized
|
56 |
|
|
panel for that entity.
|
57 |
|
|
|
58 |
|
|
VIEW MODES
|
59 |
|
|
|
60 |
|
|
Panelizer will allow you panelize each view mode individually. One view mode,
|
61 |
|
|
the "Full page override" is not actually a view mode; it uses Page Manager to
|
62 |
|
|
completely override the output of the page the entity is viewed one. This will
|
63 |
|
|
often conflict somewhat with the Default view mode. It is recommended that you
|
64 |
|
|
do not panelize both the Default and the Full page override, but instead pick
|
65 |
|
|
whichever one you think is most needed. The actually difference between the two
|
66 |
|
|
are quite subtle: Placement of the title is different, and the comment form
|
67 |
|
|
will not appear in the default view mode but it will appear in the full page
|
68 |
|
|
override.
|
69 |
|
|
|
70 |
|
|
PERMISSIONS
|
71 |
|
|
|
72 |
|
|
Once Panelizer is enabled for an entity/bundle combination, it may be
|
73 |
|
|
necessary to visit People >> Permissions and give users appropriate
|
74 |
|
|
permissions. All of the Panelizer tabs have their own permission, and
|
75 |
|
|
if these are revoked it is possible to create panelized entities that can
|
76 |
|
|
only choose panels but not modify them.
|
77 |
|
|
|
78 |
|
|
CAVEATS
|
79 |
|
|
|
80 |
|
|
Panelizer currently uses the Page Manager to render the panelized entities.
|
81 |
|
|
At this time there is no direct support for view modes. This is a desired
|
82 |
|
|
feature, though we are somewhat hampered by Drupal only allowing 2 levels
|
83 |
|
|
of local tasks (tabs) where configuring for multiple view modes really would
|
84 |
|
|
prefer a third level.
|
85 |
|
|
|
86 |
|
|
Panelizer 7.x-3.x is Revision Aware. This has the downside that duplicating
|
87 |
|
|
panels for revisions can generate a lot of extra data. Please keep this in
|
88 |
|
|
mind -- it may be necessary to periodically clean up older revisions. Panels
|
89 |
|
|
will not duplicate a display if it thinks the display was not changed,
|
90 |
|
|
however.
|
91 |
|
|
|
92 |
|
|
API
|
93 |
|
|
|
94 |
|
|
Panelizer 7.x-3.x is constructed on an Object Oriented plugin. There is one
|
95 |
|
|
plugin per entity type and it MUST be named exactly the same as the entity
|
96 |
|
|
type. The easiest way to add Panelizer support for a custom entity is to
|
97 |
|
|
copy the node entity.
|
98 |
|
|
|
99 |
|
|
As a CTools plugin, you will be required to implement
|
100 |
|
|
hook_ctools_plugin_directory. Then copy node.inc to your plugin directory
|
101 |
|
|
as MY_ENTITY_TYPE.inc and modify the name of the handler it uses. Copy
|
102 |
|
|
PanelizerEntityNode.class.php to MyModuleEntityMyEntity.class.php -- and
|
103 |
|
|
make sure the name of this file matches the handler in your .inc file.
|
104 |
|
|
|
105 |
|
|
The required implementation pieces are straightforward. You do need to set
|
106 |
|
|
a flag if the entity supports revisions so that Panelizer can write the
|
107 |
|
|
information.
|
108 |
|
|
|
109 |
|
|
If your entity does not support bundles, you can only panelize the entire
|
110 |
|
|
entity.
|
111 |
|
|
|
112 |
|
|
Future functionality
|
113 |
|
|
- Implement panel subtabs. i.e, allow node/27/arbitrarylink to be a subtab
|
114 |
|
|
of an entity, using Panelizer.
|
115 |
|
|
- Allow some other way of panelizing entities other than bundles. Either
|
116 |
|
|
that or find a contrib module to allow users to have bundles. |