Invenio extension for community themes
Project description
Definitions and assets for themed communities at TU Wien.
The themed communities feature in InvenioRDM
Since version 13, InvenioRDM allows communities to be themed.
Under the hood, it works by registering the CommunityThemeJinjaLoader for community view functions. This is a custom Jinja template loader that renders alternative templates from a directory based on the community’s theme brand. If either of the templates involved in the rendering chain doesn’t have such an override, the “normal” template will be rendered instead. Thus, it is possible to selectively override any Jinja template involved in the rendering of a community by simply placing the desired templates in the correct path (with a themes/${BRAND}/ prefix).
For instance, the standard header template for communities is located under templates/semantic-ui/invenio_communities/details/header.html. If one wants to provide a custom template for a community with the meretneith brand, it would be placed under: templates/themes/meretneith/invenio_communities/details/header.html (the semantic-ui part can be omitted).
The theme for a community (including the brand and a limited set of custom style) can be set via the invenio shell REPL, with code snippets described in the InvenioRDM documentation, or below.
If Jinja template overrides and the limited styling is enough, then adding the templates to the InvenioRDM project definition will be sufficient. However, if extra CSS styling or custom JS is required, then it will become necessary to use mechanisms only available to extensions like this one here, or the project’s local site/ package.
Provided community themes
The following community themes are provided by this package:
Meret Neith
The Meret Neith community holds datasets from excavations of the tomb of the Egyptian queen from whom the community gets its name. Thus, the community’s theme is inspired by Egypt and desert.
We have instantiated the community theme’s style into the custom CSS that gets loaded by the base template. As such, the style key can be omitted when setting the community’s theme:
from invenio_communities.proxies import current_communities
from invenio_access.permissions import system_identity
service = current_communities.service
meretneith = service.read(system_identity, "meretneith")
meretneith_theme = {
"theme": {
"brand": "meretneith",
"enabled": True,
}
}
service.update(system_identity, "meretneith", {**meretneith.data, **meretneith_theme})
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file invenio_community_themes_tuw-2026.0.0.tar.gz.
File metadata
- Download URL: invenio_community_themes_tuw-2026.0.0.tar.gz
- Upload date:
- Size: 473.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
60ecee186faea1443fa52bd029965665ed25b0cb41d8a34dce4c6f88345b7ea6
|
|
| MD5 |
433d37f44dea9e95157f4ec38c576518
|
|
| BLAKE2b-256 |
8c706c60eebab134f8300573a67f256a5a1b109d24639d9208652b9b9706da18
|
File details
Details for the file invenio_community_themes_tuw-2026.0.0-py3-none-any.whl.
File metadata
- Download URL: invenio_community_themes_tuw-2026.0.0-py3-none-any.whl
- Upload date:
- Size: 470.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c44cf127f903efb3a080214b38c10c40deede330f2269ca437cdd7afd63e5f7c
|
|
| MD5 |
8d9b271a6f39d047d2754cfa8ff9f664
|
|
| BLAKE2b-256 |
615890f7f5452d55dafe053ee260f052b3ce10f4f5db95514375bfa8265cb8e1
|