Getting Started Omeka S module

Configuration

The module has no global settings, no site settings and no permission rules of its own. Everything is configured per block in the page editor, and anyone who can edit a site page can add and edit the blocks.

What the module registers

Registration Value
Block layouts bstHero, bstCallToAction, bstStatistics, bstTimeline, bstSearch, cardSlider, itemSlider, tabs, tabsGroup, tab, bstColumns, bstColumn
View helper override pageLayout is replaced by BlockSuite\View\Helper\PageLayout
Container registry blocksuite.containers: tabsGroup (divider tab) and bstColumns (divider bstColumn)
View templates view/common/block-layout/*.phtml and view/common/blocksuite/*.phtml (added to the template path stack)

The pageLayout override renders the container blocks. It extends the core helper and keeps everything else unchanged: the page_layout.classes and page_layout.inline_styles events, the grid page layout, and core block groups. If another module also overrides pageLayout and wins, containers degrade gracefully: the container renders nothing and the blocks inside it render in normal page order.

Registering another container

A module can add its own container block: register a block layout for the container and one for its divider, then add them to the registry in its module.config.php:

'blocksuite' => [
    'containers' => [
        'myGallery' => [
            'divider' => 'myGallerySlide',
            'partial' => 'common/block-layout/my-gallery',
        ],
    ],
],

Then:

  • The container's form() renders the common/blocksuite/container-form partial, which provides the span input and the drop zone that the page editor script (bst-admin.js, loaded on every page editor while BlockSuite is active) manages. Its onHydrate() keeps span as a non-negative integer, and its render() returns an empty string.
  • The divider's form is wrapped in an element with the data-bst-divider attribute; a text input with the bst-divider-label class is shown live in the divider's header. Its render() also returns an empty string.
  • The partial receives the variables listed in Block Data.

Per-block defaults

The table lists the defaults a block starts with and the range the module enforces on save.

Block Setting Default Allowed
Card Slider, Item Slider Show as Slider slider or grid
Card Slider, Item Slider Cards visible 3 1 to 6
Card Slider, Item Slider Autoplay off
Card Slider, Item Slider Autoplay interval 4000 ms 1000 ms minimum
Item Slider Selection mode Choose specific items curated or query
Item Slider Max items 12 1 to 50
Item Slider Link label View item
Tabs (HTML), Tabs (Blocks) Show as Tabs tabs or accordion
Tabs (HTML), Tabs (Blocks) Several sections open off
Columns (Blocks) Widths, space, alignment Equal, Medium, Equal height see Columns (Blocks)
Hero Heading level, height, overlay, alignment h2, Standard, Standard, Left
Hero Buttons none up to 2
Call to Action Background, alignment Lightly tinted, Centered
Call to Action Buttons none up to 3
Statistics Style, alignment Plain figures, Centered up to 12 figures
Timeline Events none up to 50
Search Box Search Everything on this site up to 12 suggestions

Theme overrides

A theme can override any public template by copying it to the same path inside the theme, for example:

themes/<theme>/view/common/block-layout/hero.phtml
themes/<theme>/view/common/block-layout/card-slider.phtml
themes/<theme>/view/common/blocksuite/accordion.phtml

Every block except the containers and dividers also supports Omeka's block templates: a theme can list alternative templates for a layout under block_templates in its theme.ini, and editors pick one under Configure layout. Keep the class names and ARIA attributes if you want the bundled script to keep working. See Theming and Markup.

Assets

Each block appends only what it needs, through its prepareRender(), and only on pages that use it:

File Loaded for
asset/css/bst-base.css Every block
asset/css/bst-slider.css Card Slider, Item Slider
asset/css/bst-tabs.css Tabs (HTML), Tabs (Blocks)
asset/css/bst-content.css Columns, Hero, Call to Action, Statistics, Timeline, Search Box
asset/js/bst.js Sliders, tabs and accordions (loaded with defer)

The page editor loads asset/css/bst-admin.css and asset/js/bst-admin.js, plus the older card-slider-admin.js, item-slider-admin.js and tabs-admin.js for those blocks' forms.

Log in for Support