Blocks Disposition (module for Omeka S)
New versions of this module and support for Omeka S version 3.0 and above are available on GitLab, which seems to respect users and privacy better than the previous repository.
Blocks Disposition is a module for Omeka S that allows to manage automatic display of features of the modules in the resource pages.
For example, it can display the viewer Mirador or Universal Viewer, then the citation provided by the module Citation, then the map of the module Mapping. then the tagging form of the module Folksonomy, then the comments of the module Comment, etc. Without this module, these features would be displayed in the alphabetic order, so the theme would be edited to get the same result.
So, this module simplifies the creation of the five main public views (item/show,
item/browse, item-set/show, item-set/browse, media/show), and make them
reorderable directly in the admin interface, like the simple pages.
Installation
Uncompress files and rename module folder BlocksDisposition. Then install it
like any other Omeka module and follow the config instructions.
See general end user documentation for installing a module.
Usage
The options can be set differently for each site in the site settings, under
Blocks Disposition. Enable the management of the display for the site, then
select and set the order of each feature for each type of page. When it is not
enabled, the modules are displayed as set by the theme. When it is enabled and
no module is checked for a type of page, no managed module is displayed there.
The process uses the trigger view.show.before to reorder the modules that use
the trigger view.show.after, so they must not be removed from the theme. It is
the same for the triggers view.browse.before and view.browse.after.
Only the modules that display something in the resource pages, listed in the
config, are managed. The other listeners are kept in place with their priority,
for example the noindex of the core, the canonical url of the module CleanUrl
or the meta tags of the module MetaTags. All the listeners of a managed module
are kept, in their order.
Since Omeka S v4.1, the themes may manage the resource page blocks, that allow to place the blocks of the modules in the resource pages of each site. For a site with such a theme, this module is not applied to the resource pages (item, media and item set) and their settings are only displayed, so they are kept. The lists of resources, that have no resource page blocks, are still managed. When all the themes of the sites manage the resource page blocks, a message in the list of modules indicates that the module is used only for the lists.
Some modules may not be listed: add them in the module config/module.config.php. This module is not yet enable to determine all modules that are used in the public resources pages
Compatibility warning
Some module blocks are not sortable, because they use closures instead of a simple object/method callable, so the module doesn’t know the initial module.
So to make them orderable, closures should be replaced by raw callable. For
example, for module Mapping, the method attachListeners() in the main file
of the module modules/Mapping/Module.php must be updated:
101 $sharedEventManager->attach(
102 'Omeka\Controller\Site\Item',
103 'view.show.after',
104-- function (Event $event) {
105-- echo $event->getTarget()->partial('mapping/index/show');
106-- }
++ [$this, 'handleViewShowAfterItem']
107 );
Add:
public function handleViewShowAfterItem(Event $event)
{
echo $event->getTarget()->partial('mapping/index/show');
}
This process creates a cleaner code too, since loading step is not mixed with
the display step in the same method. This fix is the same for any module that
uses a closure for the public trigger view.show.after, for example Collecting.
Another point to check is the fact that the namespace of the callable that is triggered must be the same than the module name. This is always the case for all known public modules.
NOTE This fix is integrated upstream in last version of Mapping, Collecting, and some other modules, so you only have to check your own modules.
TODO
- [ ] Determine the list of modules automatically via the events they listen.
- [ ] Manage events "view.layout" so appended blocks can be prepended and vice-versa.
Warning
Use it at your own risk.
It’s always recommended to backup your files and your databases and to check your archives regularly so you can roll back if needed.
Troubleshooting
See online issues on the module issues page on GitLab.
License
This module is published under the CeCILL v2.1 license, compatible with GNU/GPL and approved by FSF and OSI.
In consideration of access to the source code and the rights to copy, modify and redistribute granted by the license, users are provided only with a limited warranty and the software’s author, the holder of the economic rights, and the successive licensors only have limited liability.
In this respect, the risks associated with loading, using, modifying and/or developing or reproducing the software by the user are brought to the user’s attention, given its Free Software status, which may make it complicated to use, with the result that its use is reserved for developers and experienced professionals having in-depth computer knowledge. Users are therefore encouraged to load and test the suitability of the software as regards their requirements in conditions enabling the security of their systems and/or data to be ensured and, more generally, to use and operate it in the same conditions of security. This Agreement may be freely reproduced and published, provided it is not altered, and that no provisions are either added or removed herefrom.
Copyright
- Copyright Daniel Berthereau, 2019-2026 (see Daniel-KM on GitLab)