Daniel-KM / Omeka-plugin-Scripto

Plugin for Omeka that adds the ability to transcribe items using the Scripto library.
0 stars 2 forks source link

Hook callback order #8

Open pfabri opened 7 years ago

pfabri commented 7 years ago

Dear Daniel,

How can I alter the callback order of plugin hooks? On public_items_show Scripto loads first followed by UniversalViewer. So this is what I get:

image

This is not ideal for documents with many pages, as the viewer will be way down on the page, and it isn't very logical having this order on the page: 1. option to transcribe 2. UV 3. current transcription.

This order would make a lot more sense: 1. UV 2. current transcription 3. option to transcribe more

I managed to do a bit of html workaround using an accordion, so that the associated pages are only displayed if the accordion is open.

image

Nonetheless I would very much like to know how to alter the order in which callback functions are called. Could you please put point me in the right direction?

Many thanks, Peter

Daniel-KM commented 7 years ago

In the config of UniversalViewer, you can disable the automatic append of the viewer; then in the theme, you add <?php echo $this->universalViewer($item); ?> where you want.

pfabri commented 7 years ago

Perfect, thank you very much! Just out of curiosity, if your plugin didn't have the option not to automatically append UV, and I'd have to resort to altering the order of hook callbacks, how would I do that? Where could I find info on this? I've consulted the Omeka manual, but I couldn't really find a workable example.

Best wishes,- Peter

Daniel-KM commented 7 years ago

You have the functions get_plugin_hook_output() and get_specific_plugin_hook_output() in globals.php.