Model UI
Model UI customization lets you tailor the user interface for specific record types in your repository. Each record model (datasets, publications, documents, etc.) can have its own customized search results, deposit forms, and detail views.
What is Model UI?
In NRP repositories, Model UI refers to the front-end components and views that are specific to a record model. While the Repository UI provides shared components used across all pages, Model UI components are scoped to individual record types.
For example, a publication repository might need:
- Search result items that display journal names, DOI, and citation counts
- Deposit forms with fields for authors, affiliations, and publication venues
- Detail pages that show full citation data and download links
Each record model defines its own UI resources that handle these page views, and Model UI customization lets you override the defaults to match your specific needs.
Page Customization Approaches
There are three ways to customize model pages, from simplest to most complex:
- Default page components (default) — The system uses pre-defined JinjaX page components (
oarepo_ui.pages.*) that extend the appropriate base template. No configuration required. - Model-specific partials — Create partial templates using predictable naming patterns (e.g.,
{model_name}/record_detail/main.html,{model_name}/record_search/main.html) to override specific sections while keeping the base layout. - Custom page components — Configure the
templatesdictionary in yourRecordsUIResourceConfigto specify full JinjaX components for complete control over the page structure.
Backward compatibility: Existing configurations using templates = {...} continue to work unchanged. The default page component is used when no template is explicitly configured for a given page type.
Default Page Components
When a page template is not explicitly configured, the system uses a pre-defined JinjaX page component. These components eliminate the need for boilerplate configuration while still allowing full customization when needed.
How It Works
The default page component:
- Declares all context variables in a
{# def #}block - Extends the appropriate base template for the page type
- Is provided by
oarepo-uiand maintained as part of the framework
Page Types and Base Templates
Each page type has a default base template that the page component extends:
| Page Type | Base Template |
|---|---|
record_detail | {model_name}/record_detail.html |
search | {model_name}/record_search.html |
deposit_create | {model_name}/deposit_create.html |
deposit_edit | {model_name}/deposit_edit.html |
tombstone | tombstone.html |
not_found | not_found.html |
The base templates follow predictable naming patterns, making it easy to create model-specific overrides by placing templates at the appropriate path in your repository’s template folder.
When to Customize
- Use default page components when the default layout and behavior meet your needs
- Create model-specific partials when you need to customize specific sections (main content, sidebars, etc.) while keeping the overall structure
- Configure custom components when you need complete control over the page structure or props
Related Concepts
Model UI vs Repository UI:
- Repository UI — Shared components, theming, templating, and generic UI infrastructure
- Model UI — Record-type-specific pages and components for search, deposit, and detail views
Both work together: Repository UI provides the foundation (components, templates, theming), while Model UI applies it to specific record types.
Customization Topics
Customizing the search UI and result items for your record model.
Search resultCustomizing the deposit form fields and validation.
Deposit formCustomizing the detail/landing page for individual records.
Record landing pageAvailable search result item components.
Search result componentsAvailable deposit form field components.
Deposit form components