Skip to content

Commit

Permalink
Add theme variable section to README.
Browse files Browse the repository at this point in the history
  • Loading branch information
alxp committed Mar 5, 2024
1 parent 1f869fe commit 4dc683f
Showing 1 changed file with 50 additions and 0 deletions.
50 changes: 50 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,56 @@ Configure contexts at "Administration » Structure » Context".
As noted previously, this is just one way to set up the Mirador viewer configurations. If, for example, you wanted to always use the Mirador viewer for pages and paged content, you could remove the "Mirador" condition from the "Node has term" condition in these contexts.


## Theme Variables

Mirador's appearance and behaviour is configured via settings passed
to the JavaScript application. Mainly in 'window' and 'workspace' configuration
array.

These can be specified via theme variables or by passing
them as arguments instantiating the Mirador block class.

To hide the close button via a theme hook:

```php
function mymodule_preprocess_mirador(&$variables) {
$variables['window_config']['allowClose'] = FALSE;
}
```

To make a minimal UI by instantiating the block:

```php
$block = \Drupal::service('plugin.manager.block')->createInstance($viewer . '_block', [
'iiif_manifest_url' => "/node/$manifest_nid/manifest-single",
'thumbnail_navigation_position' => 'hidden',
'window_config' => [
'allowClose' => FALSE,
'allowMaximize' => FALSE,
'allowTopMenuButton' => FALSE,
'allowWindowSideBar' => FALSE,
'hideWindowTitle' => TRUE,
'panels' => [
'info' => FALSE,
'attribution' => FALSE,
' canvas' => FALSE,
'annotations' => FALSE,
'search' => FALSE,
],
],
'workspace_config' => [
'allowNewWindows' => FALSE,
'isWorkspaceAddVisible' => FALSE,
'workspaceControlPanel' => [
'enable' => FALSE,
],

],
]);

```

See the Mirador FAQ for more options: https://github.com/ProjectMirador/mirador/wiki/M3---Mirador-3-Frequently-Asked-Questions

## Documentation

Expand Down

0 comments on commit 4dc683f

Please sign in to comment.