Reference for theme authors and for anyone editing exported configuration files.
Block layouts
| Layout name | Label in the admin | Compatible pages | Renders |
|---|---|---|---|
valueSplitterA |
Value Splitter: Primary | items, media, item_sets | Values of the properties assigned to block A |
valueSplitterB |
Value Splitter: Secondary | items, media, item_sets | Values of the properties assigned to block B |
valueSplitterC |
Value Splitter: Media | items, media, item_sets | Every media attached to the item, via $media->render() |
valueSplitterD |
Value Splitter: Overflow | items, media, item_sets | All properties not assigned to A or B (catch-all), or its own property list |
The layout names are what appears in a theme's theme.ini resource_page_blocks defaults and in the theme settings Omeka stores when you save Configure resource pages. A theme can ship with the blocks pre-placed:
resource_page_blocks.items.main[] = "valueSplitterA"
resource_page_blocks.items.main[] = "valueSplitterC"
resource_page_blocks.items.main[] = "valueSplitterB"
resource_page_blocks.items.main[] = "valueSplitterD"
Blocks A, B and D render values with $resource->displayValues(), passing properties (A, B, D without catch-all) or excludeProperties (D with catch-all), and siteId when the site setting Exclude resources not in site is on. The value markup is therefore Omeka's standard common/resource-values template, and a theme that overrides that template affects these blocks too.
Templates
Each block renders a partial that a theme can override by placing a file at the same path in the theme's view/ directory:
common/resource-page-block-layout/value-block-a.phtmlcommon/resource-page-block-layout/value-block-b.phtmlcommon/resource-page-block-layout/value-block-c.phtmlcommon/resource-page-block-layout/value-block-d.phtml
The partial receives $resource and reads the configuration with $this->siteSetting('value_splitter_config').
Markup and CSS
Every block outputs a wrapper with these classes:
<div class="value-block value-block-a">
<h4 class="value-block-label">Label</h4>
... Omeka value markup ...
</div>
| Class | Where |
|---|---|
value-block |
Wrapper of every block |
value-block-a, value-block-b, value-block-c, value-block-d |
Wrapper, identifies the block |
value-block-empty |
Added to the wrapper when the block has nothing to show |
value-block-label |
The optional <h4> heading |
value-block-placeholder-text |
The No values available. / No media available. paragraph |
media-embeds |
Container around the rendered media in block C |
The module appends a small stylesheet, asset/css/value-splitter.css, that sets a bottom margin on .value-block, sizes the label and greys out the placeholder text. Override these rules in the theme's own CSS.
Configuration file format
Export downloads, and Import accepts, the following JSON. It is the same structure stored in the site setting value_splitter_config.
{
"blocks": {
"a": {
"label": "About this item",
"properties": ["dcterms:title", "dcterms:description"],
"empty_behavior": "hidden"
},
"b": {
"label": "Details",
"properties": ["dcterms:date", "dcterms:creator"],
"empty_behavior": "placeholder"
},
"c": {
"label": "",
"show_media": true,
"empty_behavior": "hidden"
},
"d": {
"label": "Other metadata",
"properties": [],
"catch_all": true,
"empty_behavior": "visible"
}
}
}
| Key | Type | Values |
|---|---|---|
label |
string | Any text; empty for no heading |
properties |
array of strings | Property terms such as dcterms:subject |
empty_behavior |
string | hidden, placeholder or visible |
show_media (block c only) |
boolean | true to render media |
catch_all (block d only) |
boolean | true to show all properties not in blocks a and b |
Import checks only that a top-level blocks key exists; unknown terms are stored as given and simply match no values.
Routes
| Route | Method | Purpose |
|---|---|---|
/admin/value-splitter |
GET | Configuration page; ?site_id=ID selects the site |
/admin/value-splitter/save |
POST | Save the form |
/admin/value-splitter/export/:site_id |
GET | Download value-splitter-config.json |
/admin/value-splitter/import |
POST | Upload a JSON file (import_file) for the site in site_id |
All routes require the editor role or higher.